@eventcatalog/core 3.0.0-beta.1 → 3.0.0-beta.3
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-3W6JYTHP.js → chunk-AA77FVIB.js} +6 -2
- package/dist/chunk-AVU3AN7Z.js +44 -0
- package/dist/{chunk-FH5AN4Z6.js → chunk-LQRZDAAR.js} +1 -1
- package/dist/{chunk-M6QG3NPM.js → chunk-NCPOSHDA.js} +1 -1
- package/dist/{chunk-KE2IUVK6.js → chunk-QCG2IR3D.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +64 -18
- package/dist/eventcatalog.js +25 -14
- 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/src/components/MDX/NodeGraph/NodeGraph.tsx +45 -3
- package/eventcatalog/src/pages/auth/login.astro +2 -2
- package/package.json +2 -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-QCG2IR3D.js";
|
|
4
|
+
import "../chunk-NCPOSHDA.js";
|
|
5
|
+
import "../chunk-LQRZDAAR.js";
|
|
6
6
|
import "../chunk-UPONRQSN.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
logger
|
|
3
|
+
} from "./chunk-AVU3AN7Z.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
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
VERSION
|
|
3
|
+
} from "./chunk-LQRZDAAR.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
|
+
};
|
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.3";
|
|
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.1";
|
|
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})`;
|
|
@@ -687,7 +725,7 @@ var createAuthFileIfNotExists = async (hasRequiredLicense) => {
|
|
|
687
725
|
const isSRR = await isOutputServer();
|
|
688
726
|
try {
|
|
689
727
|
if (authEnabled && hasRequiredLicense && isSRR) {
|
|
690
|
-
|
|
728
|
+
logger.info("Creating auth file", "auth");
|
|
691
729
|
import_fs2.default.writeFileSync(
|
|
692
730
|
(0, import_node_path7.join)(core, "src/pages/api/[...auth].ts"),
|
|
693
731
|
`import { AstroAuth } from 'auth-astro/server';
|
|
@@ -731,14 +769,17 @@ Run npm i @eventcatalog/core to update`;
|
|
|
731
769
|
}
|
|
732
770
|
};
|
|
733
771
|
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
|
-
|
|
772
|
+
logger.welcome();
|
|
773
|
+
logger.info("Setting up EventCatalog...", "eventcatalog");
|
|
774
|
+
const isServer = await isOutputServer();
|
|
775
|
+
logger.info(isServer ? "EventCatalog is running in Server Mode" : "EventCatalog is running in Static Mode", "config");
|
|
735
776
|
if (import_fs2.default.existsSync(import_node_path8.default.join(dir, ".env"))) {
|
|
736
777
|
import_dotenv.default.config({ path: import_node_path8.default.join(dir, ".env") });
|
|
737
778
|
}
|
|
738
779
|
if (options.debug) {
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
780
|
+
logger.info("Debug mode enabled", "debug");
|
|
781
|
+
logger.info(`PROJECT_DIR: ${dir}`, "debug");
|
|
782
|
+
logger.info(`CATALOG_DIR: ${core}`, "debug");
|
|
742
783
|
}
|
|
743
784
|
if (options.forceRecreate) clearCore();
|
|
744
785
|
copyCore();
|
|
@@ -786,7 +827,10 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
786
827
|
}
|
|
787
828
|
});
|
|
788
829
|
program.command("build").description("Run build of EventCatalog").action(async (options, command) => {
|
|
789
|
-
|
|
830
|
+
logger.welcome();
|
|
831
|
+
logger.info("Building EventCatalog...", "build");
|
|
832
|
+
const isServer = await isOutputServer();
|
|
833
|
+
logger.info(isServer ? "EventCatalog is running in Server Mode" : "EventCatalog is running in Static Mode", "config");
|
|
790
834
|
if (import_fs2.default.existsSync(import_node_path8.default.join(dir, ".env"))) {
|
|
791
835
|
import_dotenv.default.config({ path: import_node_path8.default.join(dir, ".env") });
|
|
792
836
|
}
|
|
@@ -850,7 +894,8 @@ var startServerCatalog = ({
|
|
|
850
894
|
);
|
|
851
895
|
};
|
|
852
896
|
program.command("preview").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
|
|
853
|
-
|
|
897
|
+
logger.welcome();
|
|
898
|
+
logger.info("Starting preview of your build...", "preview");
|
|
854
899
|
if (import_fs2.default.existsSync(import_node_path8.default.join(dir, ".env"))) {
|
|
855
900
|
import_dotenv.default.config({ path: import_node_path8.default.join(dir, ".env") });
|
|
856
901
|
}
|
|
@@ -865,7 +910,8 @@ program.command("preview").description("Serves the contents of your eventcatalog
|
|
|
865
910
|
previewCatalog({ command, canEmbedPages: canEmbedPages || isEventCatalogScale, isEventCatalogStarter, isEventCatalogScale });
|
|
866
911
|
});
|
|
867
912
|
program.command("start").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
|
|
868
|
-
|
|
913
|
+
logger.welcome();
|
|
914
|
+
logger.info("Starting preview of your build...", "preview");
|
|
869
915
|
if (import_fs2.default.existsSync(import_node_path8.default.join(dir, ".env"))) {
|
|
870
916
|
import_dotenv.default.config({ path: import_node_path8.default.join(dir, ".env") });
|
|
871
917
|
}
|
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-QCG2IR3D.js";
|
|
10
|
+
import "./chunk-NCPOSHDA.js";
|
|
11
11
|
import {
|
|
12
12
|
runMigrations
|
|
13
13
|
} from "./chunk-BH3JMNAV.js";
|
|
@@ -17,16 +17,19 @@ import {
|
|
|
17
17
|
checkAndConvertMdToMdx
|
|
18
18
|
} from "./chunk-R2BJ7MJG.js";
|
|
19
19
|
import "./chunk-55D645EH.js";
|
|
20
|
-
import {
|
|
21
|
-
VERSION
|
|
22
|
-
} from "./chunk-FH5AN4Z6.js";
|
|
23
20
|
import {
|
|
24
21
|
isAuthEnabled,
|
|
25
22
|
isOutputServer
|
|
26
23
|
} from "./chunk-5VBIXL6C.js";
|
|
27
24
|
import {
|
|
28
25
|
generate
|
|
29
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-AA77FVIB.js";
|
|
27
|
+
import {
|
|
28
|
+
logger
|
|
29
|
+
} from "./chunk-AVU3AN7Z.js";
|
|
30
|
+
import {
|
|
31
|
+
VERSION
|
|
32
|
+
} from "./chunk-LQRZDAAR.js";
|
|
30
33
|
import "./chunk-UPONRQSN.js";
|
|
31
34
|
|
|
32
35
|
// src/eventcatalog.ts
|
|
@@ -96,7 +99,7 @@ var createAuthFileIfNotExists = async (hasRequiredLicense) => {
|
|
|
96
99
|
const isSRR = await isOutputServer();
|
|
97
100
|
try {
|
|
98
101
|
if (authEnabled && hasRequiredLicense && isSRR) {
|
|
99
|
-
|
|
102
|
+
logger.info("Creating auth file", "auth");
|
|
100
103
|
fs.writeFileSync(
|
|
101
104
|
join(core, "src/pages/api/[...auth].ts"),
|
|
102
105
|
`import { AstroAuth } from 'auth-astro/server';
|
|
@@ -140,14 +143,17 @@ Run npm i @eventcatalog/core to update`;
|
|
|
140
143
|
}
|
|
141
144
|
};
|
|
142
145
|
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
|
-
|
|
146
|
+
logger.welcome();
|
|
147
|
+
logger.info("Setting up EventCatalog...", "eventcatalog");
|
|
148
|
+
const isServer = await isOutputServer();
|
|
149
|
+
logger.info(isServer ? "EventCatalog is running in Server Mode" : "EventCatalog is running in Static Mode", "config");
|
|
144
150
|
if (fs.existsSync(path.join(dir, ".env"))) {
|
|
145
151
|
dotenv.config({ path: path.join(dir, ".env") });
|
|
146
152
|
}
|
|
147
153
|
if (options.debug) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
154
|
+
logger.info("Debug mode enabled", "debug");
|
|
155
|
+
logger.info(`PROJECT_DIR: ${dir}`, "debug");
|
|
156
|
+
logger.info(`CATALOG_DIR: ${core}`, "debug");
|
|
151
157
|
}
|
|
152
158
|
if (options.forceRecreate) clearCore();
|
|
153
159
|
copyCore();
|
|
@@ -195,7 +201,10 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
195
201
|
}
|
|
196
202
|
});
|
|
197
203
|
program.command("build").description("Run build of EventCatalog").action(async (options, command) => {
|
|
198
|
-
|
|
204
|
+
logger.welcome();
|
|
205
|
+
logger.info("Building EventCatalog...", "build");
|
|
206
|
+
const isServer = await isOutputServer();
|
|
207
|
+
logger.info(isServer ? "EventCatalog is running in Server Mode" : "EventCatalog is running in Static Mode", "config");
|
|
199
208
|
if (fs.existsSync(path.join(dir, ".env"))) {
|
|
200
209
|
dotenv.config({ path: path.join(dir, ".env") });
|
|
201
210
|
}
|
|
@@ -259,7 +268,8 @@ var startServerCatalog = ({
|
|
|
259
268
|
);
|
|
260
269
|
};
|
|
261
270
|
program.command("preview").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
|
|
262
|
-
|
|
271
|
+
logger.welcome();
|
|
272
|
+
logger.info("Starting preview of your build...", "preview");
|
|
263
273
|
if (fs.existsSync(path.join(dir, ".env"))) {
|
|
264
274
|
dotenv.config({ path: path.join(dir, ".env") });
|
|
265
275
|
}
|
|
@@ -274,7 +284,8 @@ program.command("preview").description("Serves the contents of your eventcatalog
|
|
|
274
284
|
previewCatalog({ command, canEmbedPages: canEmbedPages || isEventCatalogScale, isEventCatalogStarter, isEventCatalogScale });
|
|
275
285
|
});
|
|
276
286
|
program.command("start").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
|
|
277
|
-
|
|
287
|
+
logger.welcome();
|
|
288
|
+
logger.info("Starting preview of your build...", "preview");
|
|
278
289
|
if (fs.existsSync(path.join(dir, ".env"))) {
|
|
279
290
|
dotenv.config({ path: path.join(dir, ".env") });
|
|
280
291
|
}
|
package/dist/generate.cjs
CHANGED
|
@@ -69,6 +69,51 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
+
// src/utils/cli-logger.ts
|
|
73
|
+
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
74
|
+
|
|
75
|
+
// package.json
|
|
76
|
+
var version = "3.0.0-beta.3";
|
|
77
|
+
|
|
78
|
+
// src/constants.ts
|
|
79
|
+
var VERSION = version;
|
|
80
|
+
|
|
81
|
+
// src/utils/cli-logger.ts
|
|
82
|
+
var getTimestamp = () => {
|
|
83
|
+
const now = /* @__PURE__ */ new Date();
|
|
84
|
+
return now.toLocaleTimeString("en-US", { hour12: false });
|
|
85
|
+
};
|
|
86
|
+
var formatMessage = (tag, message, tagColor) => {
|
|
87
|
+
return `${import_picocolors.default.dim(getTimestamp())} ${tagColor(`[${tag}]`)} ${message}`;
|
|
88
|
+
};
|
|
89
|
+
var logger = {
|
|
90
|
+
welcome: () => {
|
|
91
|
+
console.log();
|
|
92
|
+
console.log(import_picocolors.default.magenta(import_picocolors.default.bold("\u{1F680} EventCatalog")) + import_picocolors.default.dim(` (v${VERSION})`));
|
|
93
|
+
console.log(import_picocolors.default.dim("https://eventcatalog.dev"));
|
|
94
|
+
console.log();
|
|
95
|
+
console.log(
|
|
96
|
+
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")
|
|
97
|
+
);
|
|
98
|
+
console.log();
|
|
99
|
+
},
|
|
100
|
+
info: (message, tag = "info") => {
|
|
101
|
+
console.log(formatMessage(tag, message, import_picocolors.default.blue));
|
|
102
|
+
},
|
|
103
|
+
success: (message, tag = "success") => {
|
|
104
|
+
console.log(formatMessage(tag, message, import_picocolors.default.green));
|
|
105
|
+
},
|
|
106
|
+
error: (message, tag = "error") => {
|
|
107
|
+
console.log(formatMessage(tag, message, import_picocolors.default.red));
|
|
108
|
+
},
|
|
109
|
+
warning: (message, tag = "warn") => {
|
|
110
|
+
console.log(formatMessage(tag, message, import_picocolors.default.yellow));
|
|
111
|
+
},
|
|
112
|
+
dim: (message) => {
|
|
113
|
+
console.log(import_picocolors.default.dim(message));
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
72
117
|
// src/generate.js
|
|
73
118
|
function getDefaultExport(importedModule) {
|
|
74
119
|
if (importedModule === null || typeof importedModule !== "object") {
|
|
@@ -87,7 +132,7 @@ var generate = async (PROJECT_DIRECTORY) => {
|
|
|
87
132
|
const config = await getEventCatalogConfigFile(PROJECT_DIRECTORY);
|
|
88
133
|
const { generators = [] } = config;
|
|
89
134
|
if (!generators.length) {
|
|
90
|
-
|
|
135
|
+
logger.info("No configured generators found, skipping generation", "generator");
|
|
91
136
|
return;
|
|
92
137
|
}
|
|
93
138
|
for (const generator of generators) {
|
|
@@ -104,7 +149,8 @@ var generate = async (PROJECT_DIRECTORY) => {
|
|
|
104
149
|
const generator2 = getDefaultExport(importedGenerator);
|
|
105
150
|
await generator2({ eventCatalogConfig: {} }, pluginConfig);
|
|
106
151
|
} catch (error) {
|
|
107
|
-
|
|
152
|
+
logger.error("Error loading plugin:", "generator");
|
|
153
|
+
console.error(error);
|
|
108
154
|
await cleanup(PROJECT_DIRECTORY);
|
|
109
155
|
return;
|
|
110
156
|
}
|
package/dist/generate.js
CHANGED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/utils/cli-logger.ts
|
|
31
|
+
var cli_logger_exports = {};
|
|
32
|
+
__export(cli_logger_exports, {
|
|
33
|
+
logger: () => logger
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(cli_logger_exports);
|
|
36
|
+
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
37
|
+
|
|
38
|
+
// package.json
|
|
39
|
+
var version = "3.0.0-beta.3";
|
|
40
|
+
|
|
41
|
+
// src/constants.ts
|
|
42
|
+
var VERSION = version;
|
|
43
|
+
|
|
44
|
+
// src/utils/cli-logger.ts
|
|
45
|
+
var getTimestamp = () => {
|
|
46
|
+
const now = /* @__PURE__ */ new Date();
|
|
47
|
+
return now.toLocaleTimeString("en-US", { hour12: false });
|
|
48
|
+
};
|
|
49
|
+
var formatMessage = (tag, message, tagColor) => {
|
|
50
|
+
return `${import_picocolors.default.dim(getTimestamp())} ${tagColor(`[${tag}]`)} ${message}`;
|
|
51
|
+
};
|
|
52
|
+
var logger = {
|
|
53
|
+
welcome: () => {
|
|
54
|
+
console.log();
|
|
55
|
+
console.log(import_picocolors.default.magenta(import_picocolors.default.bold("\u{1F680} EventCatalog")) + import_picocolors.default.dim(` (v${VERSION})`));
|
|
56
|
+
console.log(import_picocolors.default.dim("https://eventcatalog.dev"));
|
|
57
|
+
console.log();
|
|
58
|
+
console.log(
|
|
59
|
+
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")
|
|
60
|
+
);
|
|
61
|
+
console.log();
|
|
62
|
+
},
|
|
63
|
+
info: (message, tag = "info") => {
|
|
64
|
+
console.log(formatMessage(tag, message, import_picocolors.default.blue));
|
|
65
|
+
},
|
|
66
|
+
success: (message, tag = "success") => {
|
|
67
|
+
console.log(formatMessage(tag, message, import_picocolors.default.green));
|
|
68
|
+
},
|
|
69
|
+
error: (message, tag = "error") => {
|
|
70
|
+
console.log(formatMessage(tag, message, import_picocolors.default.red));
|
|
71
|
+
},
|
|
72
|
+
warning: (message, tag = "warn") => {
|
|
73
|
+
console.log(formatMessage(tag, message, import_picocolors.default.yellow));
|
|
74
|
+
},
|
|
75
|
+
dim: (message) => {
|
|
76
|
+
console.log(import_picocolors.default.dim(message));
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
+
0 && (module.exports = {
|
|
81
|
+
logger
|
|
82
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const logger: {
|
|
2
|
+
welcome: () => void;
|
|
3
|
+
info: (message: string, tag?: string) => void;
|
|
4
|
+
success: (message: string, tag?: string) => void;
|
|
5
|
+
error: (message: string, tag?: string) => void;
|
|
6
|
+
warning: (message: string, tag?: string) => void;
|
|
7
|
+
dim: (message: string) => void;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { logger };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const logger: {
|
|
2
|
+
welcome: () => void;
|
|
3
|
+
info: (message: string, tag?: string) => void;
|
|
4
|
+
success: (message: string, tag?: string) => void;
|
|
5
|
+
error: (message: string, tag?: string) => void;
|
|
6
|
+
warning: (message: string, tag?: string) => void;
|
|
7
|
+
dim: (message: string) => void;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { logger };
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
import '@xyflow/react/dist/style.css';
|
|
20
20
|
import { ExternalLink, HistoryIcon } from 'lucide-react';
|
|
21
21
|
import { toPng } from 'html-to-image';
|
|
22
|
-
import { DocumentArrowDownIcon } from '@heroicons/react/24/outline';
|
|
22
|
+
import { DocumentArrowDownIcon, PresentationChartLineIcon } from '@heroicons/react/24/outline';
|
|
23
23
|
// Nodes and edges
|
|
24
24
|
import ServiceNode from './Nodes/Service';
|
|
25
25
|
import FlowNode from './Nodes/Flow';
|
|
@@ -135,6 +135,7 @@ const NodeGraphBuilder = ({
|
|
|
135
135
|
const [isSettingsOpen, setIsSettingsOpen] = useState(false);
|
|
136
136
|
const [animateMessages, setAnimateMessages] = useState(false);
|
|
137
137
|
const [activeStepIndex, setActiveStepIndex] = useState<number | null>(null);
|
|
138
|
+
const [isFullscreen, setIsFullscreen] = useState(false);
|
|
138
139
|
// const [isStudioModalOpen, setIsStudioModalOpen] = useState(false);
|
|
139
140
|
|
|
140
141
|
// Check if there are channels to determine if we need the visualizer functionality
|
|
@@ -349,6 +350,30 @@ const NodeGraphBuilder = ({
|
|
|
349
350
|
setIsStudioModalOpen(true);
|
|
350
351
|
};
|
|
351
352
|
|
|
353
|
+
const toggleFullScreen = useCallback(() => {
|
|
354
|
+
if (!document.fullscreenElement) {
|
|
355
|
+
reactFlowWrapperRef.current?.requestFullscreen().catch((err) => {
|
|
356
|
+
console.error(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`);
|
|
357
|
+
});
|
|
358
|
+
} else {
|
|
359
|
+
document.exitFullscreen();
|
|
360
|
+
}
|
|
361
|
+
}, []);
|
|
362
|
+
|
|
363
|
+
useEffect(() => {
|
|
364
|
+
const handleFullscreenChange = () => {
|
|
365
|
+
setIsFullscreen(!!document.fullscreenElement);
|
|
366
|
+
setTimeout(() => {
|
|
367
|
+
fitView({ duration: 800 });
|
|
368
|
+
}, 100);
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
document.addEventListener('fullscreenchange', handleFullscreenChange);
|
|
372
|
+
return () => {
|
|
373
|
+
document.removeEventListener('fullscreenchange', handleFullscreenChange);
|
|
374
|
+
};
|
|
375
|
+
}, [fitView]);
|
|
376
|
+
|
|
352
377
|
const handleExportVisual = useCallback(() => {
|
|
353
378
|
const imageWidth = 1024;
|
|
354
379
|
const imageHeight = 768;
|
|
@@ -563,7 +588,7 @@ const NodeGraphBuilder = ({
|
|
|
563
588
|
const isFlowVisualization = edges.some((edge: Edge) => edge.type === 'flow-edge');
|
|
564
589
|
|
|
565
590
|
return (
|
|
566
|
-
<div ref={reactFlowWrapperRef} className="w-full h-full">
|
|
591
|
+
<div ref={reactFlowWrapperRef} className="w-full h-full bg-gray-50">
|
|
567
592
|
<ReactFlow
|
|
568
593
|
nodeTypes={nodeTypes}
|
|
569
594
|
edgeTypes={edgeTypes}
|
|
@@ -583,7 +608,7 @@ const NodeGraphBuilder = ({
|
|
|
583
608
|
<Panel position="top-center" className="w-full pr-6 ">
|
|
584
609
|
<div className="flex space-x-2 justify-between items-center">
|
|
585
610
|
<div className="flex space-x-2 ml-4">
|
|
586
|
-
<div>
|
|
611
|
+
<div className="relative group">
|
|
587
612
|
<button
|
|
588
613
|
onClick={() => setIsSettingsOpen(!isSettingsOpen)}
|
|
589
614
|
className="py-2.5 px-3 bg-white rounded-md shadow-md hover:bg-purple-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500"
|
|
@@ -591,6 +616,23 @@ const NodeGraphBuilder = ({
|
|
|
591
616
|
>
|
|
592
617
|
<CogIcon className="h-5 w-5 text-gray-600" />
|
|
593
618
|
</button>
|
|
619
|
+
<div className="absolute top-full left-0 mt-2 px-2 py-1 bg-gray-900 text-white text-xs rounded shadow-lg opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-50">
|
|
620
|
+
Settings
|
|
621
|
+
</div>
|
|
622
|
+
</div>
|
|
623
|
+
<div className="relative group">
|
|
624
|
+
<button
|
|
625
|
+
onClick={toggleFullScreen}
|
|
626
|
+
className={`py-2.5 px-3 bg-white rounded-md shadow-md hover:bg-purple-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500 ${
|
|
627
|
+
isFullscreen ? 'bg-purple-50 text-purple-600' : ''
|
|
628
|
+
}`}
|
|
629
|
+
aria-label={isFullscreen ? 'Exit presentation mode' : 'Enter presentation mode'}
|
|
630
|
+
>
|
|
631
|
+
<PresentationChartLineIcon className={`h-5 w-5 ${isFullscreen ? 'text-purple-600' : 'text-gray-600'}`} />
|
|
632
|
+
</button>
|
|
633
|
+
<div className="absolute top-full left-1/2 -translate-x-1/2 mt-2 px-2 py-1 bg-gray-900 text-white text-xs rounded shadow-lg opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-50">
|
|
634
|
+
{isFullscreen ? 'Exit Presentation Mode' : 'Presentation Mode'}
|
|
635
|
+
</div>
|
|
594
636
|
</div>
|
|
595
637
|
|
|
596
638
|
{title && (
|
|
@@ -167,7 +167,7 @@ const providerConfig = {
|
|
|
167
167
|
|
|
168
168
|
<div class="text-center">
|
|
169
169
|
<a
|
|
170
|
-
href="
|
|
170
|
+
href="https://www.eventcatalog.dev/docs/development/authentication/introduction"
|
|
171
171
|
class="inline-flex items-center px-6 py-3 border border-transparent text-sm font-medium rounded-lg text-white bg-purple-600 hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500 transition-colors duration-200"
|
|
172
172
|
>
|
|
173
173
|
Read Authentication Documentation
|
|
@@ -237,7 +237,7 @@ const providerConfig = {
|
|
|
237
237
|
|
|
238
238
|
<div class="text-center">
|
|
239
239
|
<a
|
|
240
|
-
href="
|
|
240
|
+
href="https://www.eventcatalog.dev/docs/development/authentication/introduction"
|
|
241
241
|
class="inline-flex items-center px-6 py-3 border border-transparent text-sm font-medium rounded-lg text-white bg-purple-600 hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500 transition-colors duration-200"
|
|
242
242
|
>
|
|
243
243
|
Read Authentication Documentation
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "https://github.com/event-catalog/eventcatalog.git"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
|
-
"version": "3.0.0-beta.
|
|
9
|
+
"version": "3.0.0-beta.3",
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
"nanostores": "^1.1.0",
|
|
88
88
|
"pagefind": "^1.3.0",
|
|
89
89
|
"pako": "^2.1.0",
|
|
90
|
+
"picocolors": "^1.1.1",
|
|
90
91
|
"react": "^18.3.1",
|
|
91
92
|
"react-dom": "^18.3.1",
|
|
92
93
|
"react-markdown": "^10.1.0",
|