@eventcatalog/core 5.0.0-beta.1 → 5.0.0-beta.11
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/LICENSE +227 -128
- package/README.md +4 -4
- package/dist/analytics/analytics.cjs +18 -3
- package/dist/analytics/analytics.d.cts +1 -1
- package/dist/analytics/analytics.d.ts +1 -1
- package/dist/analytics/analytics.js +3 -2
- package/dist/analytics/log-build.cjs +71 -35
- package/dist/analytics/log-build.js +5 -4
- package/dist/analytics/telemetry.cjs +42 -0
- package/dist/analytics/telemetry.d.cts +20 -0
- package/dist/analytics/telemetry.d.ts +20 -0
- package/dist/analytics/telemetry.js +8 -0
- package/dist/{chunk-KYJZJLBD.js → chunk-4YFM63DS.js} +9 -3
- package/dist/{chunk-UDS3SYLZ.js → chunk-76DAAJLV.js} +56 -33
- package/dist/{chunk-TQLRG35T.js → chunk-AWOO63ME.js} +71 -45
- package/dist/chunk-CPW6G62V.js +17 -0
- package/dist/{chunk-K2ACDO7Y.js → chunk-LQZ7IG7B.js} +1 -1
- package/dist/{chunk-S2QGT7ZF.js → chunk-MFEMKQZ6.js} +1 -1
- package/dist/{chunk-Q6SD5SNQ.js → chunk-WM4QYMIA.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +204 -124
- package/dist/eventcatalog.config.d.cts +59 -1
- package/dist/eventcatalog.config.d.ts +59 -1
- package/dist/eventcatalog.js +30 -11
- package/dist/federation/federate.js +2 -2
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/runtime-dependencies/@hocuspocus__provider.mjs +3 -0
- package/dist/runtime-dependencies/@hocuspocus__server.mjs +3 -0
- package/dist/runtime-dependencies/@mcp-b__webmcp-local-relay.mjs +3 -0
- package/dist/runtime-dependencies/@mcp-b__webmcp-polyfill.mjs +3 -0
- package/dist/runtime-dependencies/manifest.json +8 -1
- package/dist/runtime-dependencies/react-hotkeys-hook.mjs +3 -0
- package/dist/runtime-dependencies/y-protocols.mjs +3 -0
- package/dist/runtime-dependencies/y-protocols__awareness.mjs +3 -0
- package/dist/runtime-dependencies/yjs.mjs +3 -0
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/dist/utils/license-status.cjs +71 -45
- package/dist/utils/license-status.d.cts +14 -5
- package/dist/utils/license-status.d.ts +14 -5
- package/dist/utils/license-status.js +1 -1
- package/eventcatalog/astro.config.mjs +5 -0
- package/eventcatalog/integrations/storage.mjs +20 -0
- package/eventcatalog/integrations/studio-server.mjs +32 -0
- package/eventcatalog/src/components/Grids/utils.tsx +0 -23
- package/eventcatalog/src/components/Header.astro +3 -3
- package/eventcatalog/src/components/MDX/CodeGroup/CodeGroup.tsx +6 -1
- package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsPanel.tsx +12 -4
- package/eventcatalog/src/components/SideNav/NestedSideBar/index.tsx +16 -7
- package/eventcatalog/src/components/SideNav/NestedSideBar/utils.ts +10 -0
- package/eventcatalog/src/components/Tables/Discover/DiscoverTable.tsx +4 -62
- package/eventcatalog/src/components/Tables/Discover/columns.tsx +17 -150
- package/eventcatalog/src/components/Tables/Resources/ResourcesTable.tsx +425 -0
- package/eventcatalog/src/components/Tables/RowActionsMenu.tsx +157 -0
- package/eventcatalog/src/components/Tables/TablePagination.tsx +82 -0
- package/eventcatalog/src/features/ai/chat-api.ts +3 -3
- package/eventcatalog/src/features/auth/middleware/middleware-auth.ts +10 -0
- package/eventcatalog/src/features/integrations/eventcatalog-features.ts +34 -1
- package/eventcatalog/src/features/mcp/apps/canvas/shared.ts +47 -0
- package/eventcatalog/src/features/mcp/apps/canvas/styles.css +22 -0
- package/eventcatalog/src/features/mcp/apps/canvas/view.tsx +276 -0
- package/eventcatalog/src/features/mcp/apps/generated/canvas.html +210 -0
- package/eventcatalog/src/features/mcp/apps/generated/viewer.html +75 -74
- package/eventcatalog/src/features/mcp/apps/shared/app-view.tsx +2 -1
- package/eventcatalog/src/features/mcp/mcp-apps.ts +6 -3
- package/eventcatalog/src/features/mcp/mcp-server.ts +36 -5
- package/eventcatalog/src/features/server/start.ts +25 -0
- package/eventcatalog/src/features/storage/database.ts +88 -0
- package/eventcatalog/src/features/storage/migrations.ts +85 -0
- package/eventcatalog/src/features/storage/sql/database.sql +5 -0
- package/eventcatalog/src/features/storage/sql/migrations/0001-studio-canvases.sql +12 -0
- package/eventcatalog/src/features/storage/sql/migrations.sql +15 -0
- package/eventcatalog/src/features/storage/sql.ts +28 -0
- package/eventcatalog/src/features/studio/agent-choreography.ts +381 -0
- package/eventcatalog/src/features/studio/api/canvases-api.ts +170 -0
- package/eventcatalog/src/features/studio/api/canvases.ts +25 -0
- package/eventcatalog/src/features/studio/api/client.ts +35 -0
- package/eventcatalog/src/features/studio/canvas-actions.ts +414 -0
- package/eventcatalog/src/features/studio/canvas-doc.ts +414 -0
- package/eventcatalog/src/features/studio/canvas-preview.ts +53 -0
- package/eventcatalog/src/features/studio/catalog-resources.ts +155 -0
- package/eventcatalog/src/features/studio/catalog.ts +171 -0
- package/eventcatalog/src/features/studio/clipboard.ts +97 -0
- package/eventcatalog/src/features/studio/components/CanvasControls.tsx +154 -0
- package/eventcatalog/src/features/studio/components/CanvasHeader.tsx +370 -0
- package/eventcatalog/src/features/studio/components/CanvasStatusMenu.tsx +117 -0
- package/eventcatalog/src/features/studio/components/Comments.tsx +770 -0
- package/eventcatalog/src/features/studio/components/ConnectAgentDialog.tsx +281 -0
- package/eventcatalog/src/features/studio/components/ConnectionsChooser.tsx +144 -0
- package/eventcatalog/src/features/studio/components/ContainerChooser.tsx +145 -0
- package/eventcatalog/src/features/studio/components/DeleteCanvasDialog.tsx +81 -0
- package/eventcatalog/src/features/studio/components/DragGhost.tsx +115 -0
- package/eventcatalog/src/features/studio/components/JoinForm.tsx +34 -0
- package/eventcatalog/src/features/studio/components/LeftPanel.tsx +314 -0
- package/eventcatalog/src/features/studio/components/Picture.tsx +21 -0
- package/eventcatalog/src/features/studio/components/Presence.tsx +286 -0
- package/eventcatalog/src/features/studio/components/PropertiesPanel.tsx +212 -0
- package/eventcatalog/src/features/studio/components/ShareDialog.tsx +260 -0
- package/eventcatalog/src/features/studio/components/StudioDesigner.tsx +1216 -0
- package/eventcatalog/src/features/studio/components/StudioNotice.astro +24 -0
- package/eventcatalog/src/features/studio/components/canvas-nodes.tsx +255 -0
- package/eventcatalog/src/features/studio/components/icons.ts +53 -0
- package/eventcatalog/src/features/studio/components/status.ts +53 -0
- package/eventcatalog/src/features/studio/edges.ts +56 -0
- package/eventcatalog/src/features/studio/flow-state.ts +92 -0
- package/eventcatalog/src/features/studio/grouping.ts +226 -0
- package/eventcatalog/src/features/studio/hooks/presence-sender.ts +46 -0
- package/eventcatalog/src/features/studio/hooks/presence-store.ts +119 -0
- package/eventcatalog/src/features/studio/hooks/use-canvas-webmcp.ts +347 -0
- package/eventcatalog/src/features/studio/hooks/use-comments.ts +54 -0
- package/eventcatalog/src/features/studio/hooks/use-follow-camera.ts +104 -0
- package/eventcatalog/src/features/studio/hooks/use-studio-flow.ts +589 -0
- package/eventcatalog/src/features/studio/identity.ts +37 -0
- package/eventcatalog/src/features/studio/layout.ts +42 -0
- package/eventcatalog/src/features/studio/levels.ts +282 -0
- package/eventcatalog/src/features/studio/node-types.ts +205 -0
- package/eventcatalog/src/features/studio/pages/[id].astro +68 -0
- package/eventcatalog/src/features/studio/pages/index.astro +784 -0
- package/eventcatalog/src/features/studio/pages/webmcp-relay.ts +27 -0
- package/eventcatalog/src/features/studio/placement.ts +197 -0
- package/eventcatalog/src/features/studio/server/canvas-mcp.ts +510 -0
- package/eventcatalog/src/features/studio/server/runtime.ts +491 -0
- package/eventcatalog/src/features/studio/server/sign-in.ts +18 -0
- package/eventcatalog/src/features/studio/server/sql/storage.sql +18 -0
- package/eventcatalog/src/features/studio/server/storage.ts +90 -0
- package/eventcatalog/src/features/studio/server/tool-icons.ts +30 -0
- package/eventcatalog/src/features/studio/studio.css +273 -0
- package/eventcatalog/src/features/studio/tool-sync.ts +75 -0
- package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +10 -5
- package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/_index.data.spec.ts +52 -63
- package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/_index.data.ts +34 -46
- package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/index.astro +11 -29
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/resources/_ResourcesPage.astro +79 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/resources/_index.data.spec.ts +32 -14
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/resources/_index.data.ts +63 -58
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/resources/index.astro +2 -62
- package/eventcatalog/src/pages/docs/services/[id]/[version]/resources/index.astro +13 -0
- package/eventcatalog/src/stores/sidebar-store/builders/domain.ts +24 -42
- package/eventcatalog/src/stores/sidebar-store/builders/flow.ts +2 -0
- package/eventcatalog/src/stores/sidebar-store/builders/message.ts +2 -0
- package/eventcatalog/src/stores/sidebar-store/builders/service.ts +23 -23
- package/eventcatalog/src/stores/sidebar-store/builders/shared.ts +13 -0
- package/eventcatalog/src/stores/sidebar-store/builders/system.ts +18 -27
- package/eventcatalog/src/stores/sidebar-store/state.ts +5 -0
- package/eventcatalog/src/styles/tailwind.css +2 -2
- package/eventcatalog/src/utils/collections/channels.ts +56 -1
- package/eventcatalog/src/utils/collections/flows.ts +50 -1
- package/eventcatalog/src/utils/collections/message-connections.ts +60 -0
- package/eventcatalog/src/utils/collections/message-triggers.ts +2 -1
- package/eventcatalog/src/utils/collections/resource-owners.ts +193 -0
- package/eventcatalog/src/utils/collections/resources.ts +310 -0
- package/eventcatalog/src/utils/collections/util.ts +31 -0
- package/eventcatalog/src/utils/feature.ts +8 -0
- package/eventcatalog/src/utils/git.ts +11 -5
- package/eventcatalog/src/utils/node-graphs/export-mermaid.ts +0 -2
- package/eventcatalog/src/utils/trial.ts +1 -1
- package/package.json +17 -12
- package/dist/runtime-dependencies/shelljs.mjs +0 -3
- package/eventcatalog/public/studio-bg.png +0 -0
- package/eventcatalog/src/components/Grids/DomainGrid.tsx +0 -838
- package/eventcatalog/src/components/Grids/MessageGrid.tsx +0 -344
- package/eventcatalog/src/components/Grids/SystemGrid.tsx +0 -185
- package/eventcatalog/src/components/Grids/components.tsx +0 -170
- package/eventcatalog/src/components/Grids/message-link.ts +0 -38
- package/eventcatalog/src/components/Studio/StudioPageModal.tsx +0 -150
- package/eventcatalog/src/components/Tables/SystemResources/SystemResourcesTable.tsx +0 -294
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/resources/_resources.spec.ts +0 -65
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/resources/_resources.ts +0 -46
- package/eventcatalog/src/pages/studio.astro +0 -316
- package/dist/{chunk-AYNZXUB5.js → chunk-KHACCTW2.js} +3 -3
|
@@ -197,6 +197,38 @@ type McpConfig = {
|
|
|
197
197
|
enabled?: boolean;
|
|
198
198
|
auth?: McpAuthConfig;
|
|
199
199
|
};
|
|
200
|
+
/**
|
|
201
|
+
* The state EventCatalog keeps for features that need it (today, Studio's canvases). Features always work on a copy
|
|
202
|
+
* held in memory by the server, so storage doesn't slow them down: it's read when the server starts and written a
|
|
203
|
+
* moment after something changes (and as the server stops).
|
|
204
|
+
*/
|
|
205
|
+
type StorageConfig =
|
|
206
|
+
/** Kept only while the server runs: lost when it restarts or redeploys (the default) */
|
|
207
|
+
{
|
|
208
|
+
type: 'memory';
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* One SQLite database file for the whole catalog, brought up to date (migrated) as `eventcatalog dev` and
|
|
212
|
+
* `eventcatalog start` start. Uses Node.js's built-in SQLite, so needs Node.js 22.13 or later.
|
|
213
|
+
*/
|
|
214
|
+
| {
|
|
215
|
+
type: 'sqlite';
|
|
216
|
+
/**
|
|
217
|
+
* The database file, relative to the catalog. In a container, put it on a volume (e.g. `/data/eventcatalog.db`)
|
|
218
|
+
* so it survives redeploys.
|
|
219
|
+
* @default '.eventcatalog/eventcatalog.db'
|
|
220
|
+
*/
|
|
221
|
+
path?: string;
|
|
222
|
+
};
|
|
223
|
+
type StudioConfig = {
|
|
224
|
+
/**
|
|
225
|
+
* Turns Studio on in production (`output: 'server'`, served with `eventcatalog start`). It's on in the dev server
|
|
226
|
+
* unless this is `false`, which turns it off everywhere. Experimental. With authentication on, only signed-in people
|
|
227
|
+
* can open canvases, and they're shown by the name and picture they signed in with.
|
|
228
|
+
* @default false
|
|
229
|
+
*/
|
|
230
|
+
enabled?: boolean;
|
|
231
|
+
};
|
|
200
232
|
type GA4Config = {
|
|
201
233
|
measurementId: string;
|
|
202
234
|
};
|
|
@@ -257,6 +289,17 @@ interface Config {
|
|
|
257
289
|
};
|
|
258
290
|
security?: {
|
|
259
291
|
checkOrigin?: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* Hosts to trust in a proxy's X-Forwarded-Host and X-Forwarded-Proto headers (server output), e.g. when deployed
|
|
294
|
+
* behind Fly.io, Railway or a load balancer that serves HTTPS. Without it, form posts (like starting a canvas in
|
|
295
|
+
* Studio) fail the origin check. Passed to Astro's `security.allowedDomains`.
|
|
296
|
+
* @example [{ hostname: 'catalog.example.com', protocol: 'https' }]
|
|
297
|
+
*/
|
|
298
|
+
allowedDomains?: {
|
|
299
|
+
hostname?: string;
|
|
300
|
+
protocol?: string;
|
|
301
|
+
port?: string;
|
|
302
|
+
}[];
|
|
260
303
|
};
|
|
261
304
|
/**
|
|
262
305
|
* Theme for the catalog UI.
|
|
@@ -270,6 +313,13 @@ interface Config {
|
|
|
270
313
|
theme?: CatalogTheme;
|
|
271
314
|
auth?: AuthConfig;
|
|
272
315
|
mcp?: McpConfig;
|
|
316
|
+
/** EventCatalog Studio: collaborative canvases (experimental) */
|
|
317
|
+
studio?: StudioConfig;
|
|
318
|
+
/**
|
|
319
|
+
* Where EventCatalog keeps state between restarts (e.g. Studio's canvases), for every feature that has some.
|
|
320
|
+
* @default { type: 'memory' }
|
|
321
|
+
*/
|
|
322
|
+
storage?: StorageConfig;
|
|
273
323
|
rss?: {
|
|
274
324
|
enabled?: boolean;
|
|
275
325
|
limit?: number;
|
|
@@ -410,6 +460,14 @@ interface Config {
|
|
|
410
460
|
queries?: {
|
|
411
461
|
tableConfiguration?: TableConfiguration;
|
|
412
462
|
};
|
|
463
|
+
/**
|
|
464
|
+
* Anonymous telemetry for `eventcatalog dev` and `eventcatalog build`.
|
|
465
|
+
* On by default. Set to false to opt out.
|
|
466
|
+
* `EVENTCATALOG_TELEMETRY_DISABLED` or `DO_NOT_TRACK` set to `1` or `true` also opts out.
|
|
467
|
+
* `cloud.analytics` stays its own opt-in for EventCatalog Cloud.
|
|
468
|
+
* @default true
|
|
469
|
+
*/
|
|
470
|
+
telemetry?: boolean;
|
|
413
471
|
cloud?: EventCatalogCloudConfig;
|
|
414
472
|
integrations?: IntegrationsConfig;
|
|
415
473
|
scalarConfiguration?: ScalarConfiguration;
|
|
@@ -418,4 +476,4 @@ interface Config {
|
|
|
418
476
|
federation?: FederationConfig;
|
|
419
477
|
}
|
|
420
478
|
|
|
421
|
-
export type { Config, FederationRuleId, FederationRuleLevel, FederationRulesConfig, FederationSourceConfig };
|
|
479
|
+
export type { Config, FederationRuleId, FederationRuleLevel, FederationRulesConfig, FederationSourceConfig, StorageConfig };
|
package/dist/eventcatalog.js
CHANGED
|
@@ -4,17 +4,18 @@ import {
|
|
|
4
4
|
import "./chunk-CA4U2JP7.js";
|
|
5
5
|
import {
|
|
6
6
|
log_build_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-76DAAJLV.js";
|
|
8
8
|
import {
|
|
9
9
|
getLicenseStatus,
|
|
10
10
|
printLicenseStatus
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-AWOO63ME.js";
|
|
12
12
|
import "./chunk-ZAZHAVKB.js";
|
|
13
13
|
import {
|
|
14
14
|
FederationConflictError,
|
|
15
15
|
FederationDiagnosticError,
|
|
16
16
|
federateCatalog
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-KHACCTW2.js";
|
|
18
|
+
import "./chunk-WRNH5C3U.js";
|
|
18
19
|
import "./chunk-5EPNFDT5.js";
|
|
19
20
|
import "./chunk-A2RZR3U4.js";
|
|
20
21
|
import "./chunk-R7Z5ALYI.js";
|
|
@@ -24,7 +25,6 @@ import {
|
|
|
24
25
|
} from "./chunk-JJPB6EOZ.js";
|
|
25
26
|
import "./chunk-SDZQJTJW.js";
|
|
26
27
|
import "./chunk-352FGP6W.js";
|
|
27
|
-
import "./chunk-WRNH5C3U.js";
|
|
28
28
|
import {
|
|
29
29
|
getProjectOutDir,
|
|
30
30
|
isAuthEnabled,
|
|
@@ -33,10 +33,10 @@ import {
|
|
|
33
33
|
} from "./chunk-MDWB5HLO.js";
|
|
34
34
|
import {
|
|
35
35
|
generate
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-WM4QYMIA.js";
|
|
37
37
|
import {
|
|
38
38
|
logger
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-LQZ7IG7B.js";
|
|
40
40
|
import {
|
|
41
41
|
resolve_catalog_dependencies_default
|
|
42
42
|
} from "./chunk-36RYTYT5.js";
|
|
@@ -50,7 +50,8 @@ import {
|
|
|
50
50
|
import {
|
|
51
51
|
watch
|
|
52
52
|
} from "./chunk-U63GDPPY.js";
|
|
53
|
-
import "./chunk-
|
|
53
|
+
import "./chunk-4YFM63DS.js";
|
|
54
|
+
import "./chunk-CPW6G62V.js";
|
|
54
55
|
import {
|
|
55
56
|
getAstroConfigPath
|
|
56
57
|
} from "./chunk-VIJJ7JKH.js";
|
|
@@ -66,7 +67,7 @@ import {
|
|
|
66
67
|
} from "./chunk-LFQJXLHG.js";
|
|
67
68
|
import {
|
|
68
69
|
VERSION
|
|
69
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-MFEMKQZ6.js";
|
|
70
71
|
import {
|
|
71
72
|
getEventCatalogConfigFile,
|
|
72
73
|
verifyRequiredFieldsAreInCatalogConfigFile
|
|
@@ -79,7 +80,7 @@ import { join } from "path";
|
|
|
79
80
|
import http from "http";
|
|
80
81
|
import fs3 from "fs";
|
|
81
82
|
import path2 from "path";
|
|
82
|
-
import { fileURLToPath } from "url";
|
|
83
|
+
import { fileURLToPath, pathToFileURL } from "url";
|
|
83
84
|
import { createRequire } from "module";
|
|
84
85
|
import boxen from "boxen";
|
|
85
86
|
import updateNotifier from "update-notifier";
|
|
@@ -1028,15 +1029,33 @@ var previewCatalog = async ({ command }) => {
|
|
|
1028
1029
|
shouldFilterLine: createAstroLineFilter()
|
|
1029
1030
|
});
|
|
1030
1031
|
};
|
|
1032
|
+
var SERVER_BOOTSTRAP = `
|
|
1033
|
+
const entry = await import(process.argv[1]);
|
|
1034
|
+
const { server } = entry.startServer();
|
|
1035
|
+
globalThis[Symbol.for('eventcatalog.http-server')] = server.server;
|
|
1036
|
+
const start = process.env.EVENTCATALOG_START_PATH;
|
|
1037
|
+
if (start) {
|
|
1038
|
+
server.server.once('listening', () => {
|
|
1039
|
+
// Where the server listens (HOST can be one address only); loopback when it listens on every address
|
|
1040
|
+
const { address, port } = server.server.address();
|
|
1041
|
+
const host = ['0.0.0.0', '::'].includes(address) ? '127.0.0.1' : address.includes(':') ? '[' + address + ']' : address;
|
|
1042
|
+
fetch('http://' + host + ':' + port + start).catch((error) => console.error('[eventcatalog] Could not start the server:', error.message));
|
|
1043
|
+
});
|
|
1044
|
+
}
|
|
1045
|
+
`;
|
|
1031
1046
|
var startServerCatalog = async () => {
|
|
1032
1047
|
const serverEntryPath = path2.join(dir, "dist", "server", "entry.mjs");
|
|
1048
|
+
const config = await getEventCatalogConfigFile(dir);
|
|
1049
|
+
const base = (config?.base || "/").replace(/\/$/, "");
|
|
1033
1050
|
await runCommandWithFilteredOutput({
|
|
1034
1051
|
command: process.execPath,
|
|
1035
|
-
args: [serverEntryPath],
|
|
1052
|
+
args: ["--input-type=module", "-e", SERVER_BOOTSTRAP, pathToFileURL(serverEntryPath).href],
|
|
1036
1053
|
cwd: dir,
|
|
1037
1054
|
env: {
|
|
1038
1055
|
PROJECT_DIR: dir,
|
|
1039
|
-
CATALOG_DIR: core
|
|
1056
|
+
CATALOG_DIR: core,
|
|
1057
|
+
ASTRO_NODE_AUTOSTART: "disabled",
|
|
1058
|
+
EVENTCATALOG_START_PATH: `${base}/_eventcatalog/start`
|
|
1040
1059
|
},
|
|
1041
1060
|
shouldFilterLine: createAstroLineFilter()
|
|
1042
1061
|
});
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
FederationConflictError,
|
|
3
3
|
FederationDiagnosticError,
|
|
4
4
|
federateCatalog
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-KHACCTW2.js";
|
|
6
|
+
import "../chunk-WRNH5C3U.js";
|
|
6
7
|
import "../chunk-5EPNFDT5.js";
|
|
7
8
|
import "../chunk-A2RZR3U4.js";
|
|
8
9
|
import "../chunk-R7Z5ALYI.js";
|
|
9
10
|
import "../chunk-JJPB6EOZ.js";
|
|
10
11
|
import "../chunk-SDZQJTJW.js";
|
|
11
12
|
import "../chunk-352FGP6W.js";
|
|
12
|
-
import "../chunk-WRNH5C3U.js";
|
|
13
13
|
import "../chunk-RFIXKATC.js";
|
|
14
14
|
export {
|
|
15
15
|
FederationConflictError,
|
package/dist/generate.cjs
CHANGED
|
@@ -112,7 +112,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
|
112
112
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
113
113
|
|
|
114
114
|
// package.json
|
|
115
|
-
var version = "5.0.0-beta.
|
|
115
|
+
var version = "5.0.0-beta.11";
|
|
116
116
|
|
|
117
117
|
// src/constants.ts
|
|
118
118
|
var VERSION = version;
|
package/dist/generate.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generate
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-WM4QYMIA.js";
|
|
4
|
+
import "./chunk-LQZ7IG7B.js";
|
|
5
|
+
import "./chunk-MFEMKQZ6.js";
|
|
6
6
|
import "./chunk-RFIXKATC.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
|
@@ -34,7 +34,11 @@
|
|
|
34
34
|
"@heroicons/react/24/outline/RectangleGroupIcon": "@heroicons__react__24__outline__RectangleGroupIcon.mjs",
|
|
35
35
|
"@heroicons/react/24/outline/ServerIcon": "@heroicons__react__24__outline__ServerIcon.mjs",
|
|
36
36
|
"@heroicons/react/24/solid": "@heroicons__react__24__solid.mjs",
|
|
37
|
+
"@hocuspocus/provider": "@hocuspocus__provider.mjs",
|
|
38
|
+
"@hocuspocus/server": "@hocuspocus__server.mjs",
|
|
37
39
|
"@iconify-json/logos": "@iconify-json__logos.mjs",
|
|
40
|
+
"@mcp-b/webmcp-local-relay": "@mcp-b__webmcp-local-relay.mjs",
|
|
41
|
+
"@mcp-b/webmcp-polyfill": "@mcp-b__webmcp-polyfill.mjs",
|
|
38
42
|
"@mermaid-js/layout-elk": "@mermaid-js__layout-elk.mjs",
|
|
39
43
|
"@mermaid-js/layout-elk/dist/mermaid-layout-elk.core.mjs": "@mermaid-js__layout-elk__dist__mermaid-layout-elk.core.mjs.mjs",
|
|
40
44
|
"@modelcontextprotocol/ext-apps": "@modelcontextprotocol__ext-apps.mjs",
|
|
@@ -107,6 +111,7 @@
|
|
|
107
111
|
"react-dom": "react-dom.mjs",
|
|
108
112
|
"react-dom/client": "react-dom__client.mjs",
|
|
109
113
|
"react-dom/server": "react-dom__server.mjs",
|
|
114
|
+
"react-hotkeys-hook": "react-hotkeys-hook.mjs",
|
|
110
115
|
"react-markdown": "react-markdown.mjs",
|
|
111
116
|
"react-syntax-highlighter": "react-syntax-highlighter.mjs",
|
|
112
117
|
"react-syntax-highlighter/dist/cjs/styles/prism": "react-syntax-highlighter__dist__cjs__styles__prism.mjs",
|
|
@@ -132,7 +137,6 @@
|
|
|
132
137
|
"rimraf": "rimraf.mjs",
|
|
133
138
|
"semver": "semver.mjs",
|
|
134
139
|
"set-cookie-parser": "set-cookie-parser.mjs",
|
|
135
|
-
"shelljs": "shelljs.mjs",
|
|
136
140
|
"sonner": "sonner.mjs",
|
|
137
141
|
"sql.js": "sql.js.mjs",
|
|
138
142
|
"tailwindcss": "tailwindcss.mjs",
|
|
@@ -140,6 +144,9 @@
|
|
|
140
144
|
"unist-util-visit": "unist-util-visit.mjs",
|
|
141
145
|
"update-notifier": "update-notifier.mjs",
|
|
142
146
|
"uuid": "uuid.mjs",
|
|
147
|
+
"y-protocols": "y-protocols.mjs",
|
|
148
|
+
"y-protocols/awareness": "y-protocols__awareness.mjs",
|
|
149
|
+
"yjs": "yjs.mjs",
|
|
143
150
|
"zod": "zod.mjs",
|
|
144
151
|
"zod/v4": "zod__v4.mjs"
|
|
145
152
|
}
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -37,10 +37,11 @@ __export(license_status_exports, {
|
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(license_status_exports);
|
|
39
39
|
var import_boxen = __toESM(require("boxen"), 1);
|
|
40
|
+
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
40
41
|
var import_license2 = require("@eventcatalog/license");
|
|
41
42
|
|
|
42
43
|
// eventcatalog/src/utils/trial.ts
|
|
43
|
-
var TRIAL_LENGTH_DAYS =
|
|
44
|
+
var TRIAL_LENGTH_DAYS = 60;
|
|
44
45
|
var LICENSE_FAQ_URL = "https://www.eventcatalog.dev/license-faq";
|
|
45
46
|
var LICENSE_RENEW_URL = "https://eventcatalog.cloud";
|
|
46
47
|
var DAY_IN_MS = 24 * 60 * 60 * 1e3;
|
|
@@ -159,75 +160,100 @@ var getLicenseAnalytics = (license = { state: "none" }, tsd) => ({
|
|
|
159
160
|
});
|
|
160
161
|
var formatDate = (date) => date.toLocaleDateString(void 0, { dateStyle: "medium" });
|
|
161
162
|
var formatDays = (days) => `${days} ${days === 1 ? "day" : "days"}`;
|
|
162
|
-
var
|
|
163
|
+
var PLAIN = { bold: (text) => text, dim: (text) => text, link: (text) => text };
|
|
164
|
+
var COLOURS = { bold: import_picocolors.default.bold, dim: import_picocolors.default.dim, link: (text) => import_picocolors.default.cyan(text) };
|
|
165
|
+
var render = ({ headline, rows, links }, colours) => {
|
|
166
|
+
const width = Math.max(0, ...[...rows, ...links].map(([label]) => label.length));
|
|
167
|
+
const row = ([label, value]) => `${colours.dim(label.padEnd(width))} ${value}`;
|
|
168
|
+
return [
|
|
169
|
+
colours.bold(headline),
|
|
170
|
+
...rows.length ? ["", ...rows.map(row)] : [],
|
|
171
|
+
...links.length ? ["", ...links.map(([label, url]) => row([label, colours.link(url)]))] : []
|
|
172
|
+
].join("\n");
|
|
173
|
+
};
|
|
174
|
+
var message = (content) => ({
|
|
175
|
+
...content,
|
|
176
|
+
text: render(content, PLAIN)
|
|
177
|
+
});
|
|
178
|
+
var getTrialRow = (tsd, now) => {
|
|
163
179
|
const trial = getTrialStatus(tsd, now);
|
|
164
180
|
if (!trial) return;
|
|
165
|
-
return
|
|
181
|
+
return [
|
|
182
|
+
"Trial",
|
|
183
|
+
trial.ended ? `Ended ${formatDate(trial.endsAt)}` : `${formatDays(trial.daysLeft)} left of ${TRIAL_LENGTH_DAYS} (ends ${formatDate(trial.endsAt)})`
|
|
184
|
+
];
|
|
166
185
|
};
|
|
167
186
|
var getLicenseStatusMessage = (license, tsd, now = Date.now()) => {
|
|
187
|
+
const licensing = ["Licensing", LICENSE_FAQ_URL];
|
|
188
|
+
const renew = ["Renew", LICENSE_RENEW_URL];
|
|
189
|
+
const licensedTo = "org" in license && license.org ? [["Licensed to", license.org]] : [];
|
|
168
190
|
if (license.state === "licensed") {
|
|
169
191
|
const daysLeft = Math.max(0, Math.ceil((license.expiresAt.getTime() - now) / DAY_IN_MS2));
|
|
170
|
-
const licensedTo = license.org ? `Licensed to ${license.org}` : "Licensed";
|
|
171
192
|
if (daysLeft < LICENSE_REMINDER_DAYS) {
|
|
172
|
-
return {
|
|
173
|
-
title: "EventCatalog
|
|
193
|
+
return message({
|
|
194
|
+
title: "EventCatalog license",
|
|
174
195
|
color: "yellow",
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
].join("\n")
|
|
180
|
-
};
|
|
196
|
+
headline: `Your commercial license expires in ${formatDays(daysLeft)}`,
|
|
197
|
+
rows: [...licensedTo, ["Expires", formatDate(license.expiresAt)]],
|
|
198
|
+
links: [renew]
|
|
199
|
+
});
|
|
181
200
|
}
|
|
182
|
-
return {
|
|
183
|
-
title: "EventCatalog
|
|
201
|
+
return message({
|
|
202
|
+
title: "EventCatalog license",
|
|
184
203
|
color: "green",
|
|
185
|
-
|
|
186
|
-
Valid until
|
|
187
|
-
|
|
204
|
+
headline: "Commercial license active",
|
|
205
|
+
rows: [...licensedTo, ["Valid until", `${formatDate(license.expiresAt)} (${formatDays(daysLeft)} left)`]],
|
|
206
|
+
links: []
|
|
207
|
+
});
|
|
188
208
|
}
|
|
189
209
|
if (license.state === "plan") return;
|
|
190
|
-
const
|
|
210
|
+
const trialRow = getTrialRow(tsd, now);
|
|
211
|
+
const trialRows = trialRow ? [trialRow] : [];
|
|
191
212
|
if (license.state === "none") {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
return {
|
|
213
|
+
const trial = getTrialStatus(tsd, now);
|
|
214
|
+
if (!trial || !trialRow) return;
|
|
215
|
+
return message({
|
|
195
216
|
title: "EventCatalog trial",
|
|
196
|
-
color: ended ? "yellow" : "green",
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
217
|
+
color: trial.ended ? "yellow" : "green",
|
|
218
|
+
headline: trial.ended ? "Your EventCatalog trial has ended" : `You're on the ${TRIAL_LENGTH_DAYS}-day EventCatalog trial`,
|
|
219
|
+
rows: trialRows,
|
|
220
|
+
links: trial.ended ? [["Get a license", LICENSE_RENEW_URL], licensing] : [licensing]
|
|
221
|
+
});
|
|
200
222
|
}
|
|
201
223
|
if (license.state === "expired") {
|
|
202
|
-
const expiredOn = license.expiresAt ?
|
|
203
|
-
|
|
204
|
-
|
|
224
|
+
const expiredOn = license.expiresAt ? [
|
|
225
|
+
[
|
|
226
|
+
"Expired",
|
|
227
|
+
`${formatDate(license.expiresAt)} (${formatDays(Math.floor((now - license.expiresAt.getTime()) / DAY_IN_MS2))} ago)`
|
|
228
|
+
]
|
|
229
|
+
] : [];
|
|
230
|
+
return message({
|
|
231
|
+
title: "EventCatalog license",
|
|
205
232
|
color: "yellow",
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
`Learn about licensing: ${LICENSE_FAQ_URL}`
|
|
211
|
-
].filter(Boolean).join("\n")
|
|
212
|
-
};
|
|
233
|
+
headline: "Your commercial license has expired",
|
|
234
|
+
rows: [...licensedTo, ...expiredOn, ...trialRows],
|
|
235
|
+
links: [renew, licensing]
|
|
236
|
+
});
|
|
213
237
|
}
|
|
214
|
-
return {
|
|
238
|
+
return message({
|
|
215
239
|
title: "EventCatalog license",
|
|
216
240
|
color: "yellow",
|
|
217
|
-
|
|
218
|
-
|
|
241
|
+
headline: "Your license.jwt couldn't be verified",
|
|
242
|
+
rows: [["Reason", license.reason.charAt(0).toUpperCase() + license.reason.slice(1)], ...trialRows],
|
|
243
|
+
links: [licensing]
|
|
244
|
+
});
|
|
219
245
|
};
|
|
220
246
|
var printLicenseStatus = (license, tsd) => {
|
|
221
|
-
const
|
|
222
|
-
if (!
|
|
247
|
+
const status = getLicenseStatusMessage(license, tsd);
|
|
248
|
+
if (!status) return;
|
|
223
249
|
console.log(
|
|
224
|
-
(0, import_boxen.default)(
|
|
225
|
-
padding: 1,
|
|
250
|
+
(0, import_boxen.default)(render(status, COLOURS), {
|
|
251
|
+
padding: { top: 1, bottom: 1, left: 2, right: 2 },
|
|
226
252
|
margin: 1,
|
|
227
253
|
borderStyle: "round",
|
|
228
|
-
borderColor:
|
|
229
|
-
title:
|
|
230
|
-
titleAlignment: "
|
|
254
|
+
borderColor: status.color,
|
|
255
|
+
title: status.title,
|
|
256
|
+
titleAlignment: "left"
|
|
231
257
|
})
|
|
232
258
|
);
|
|
233
259
|
};
|
|
@@ -15,14 +15,23 @@ declare const getLicenseAnalytics: (license?: LicenseStatus, tsd?: unknown) => {
|
|
|
15
15
|
licenseExpiry: number | undefined;
|
|
16
16
|
trialExpiry: number | undefined;
|
|
17
17
|
};
|
|
18
|
+
type Row = [label: string, value: string];
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
+
* What the license box says: a headline, the facts as aligned rows ("Licensed to acme"), and links on their own
|
|
21
|
+
* rows, so it can be read at a glance. `text` is the box's content without colours.
|
|
20
22
|
*/
|
|
21
|
-
|
|
23
|
+
type LicenseStatusMessage = {
|
|
22
24
|
title: string;
|
|
23
|
-
color:
|
|
25
|
+
color: 'green' | 'yellow';
|
|
26
|
+
headline: string;
|
|
27
|
+
rows: Row[];
|
|
28
|
+
links: Row[];
|
|
24
29
|
text: string;
|
|
25
|
-
}
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The license (or trial) box for the terminal. Undefined when there's nothing to show.
|
|
33
|
+
*/
|
|
34
|
+
declare const getLicenseStatusMessage: (license: LicenseStatus, tsd: unknown, now?: number) => LicenseStatusMessage | undefined;
|
|
26
35
|
declare const printLicenseStatus: (license: LicenseStatus, tsd: unknown) => void;
|
|
27
36
|
|
|
28
|
-
export { LicenseStatus, getLicenseAnalytics, getLicenseStatus, getLicenseStatusMessage, printLicenseStatus };
|
|
37
|
+
export { LicenseStatus, type LicenseStatusMessage, getLicenseAnalytics, getLicenseStatus, getLicenseStatusMessage, printLicenseStatus };
|
|
@@ -15,14 +15,23 @@ declare const getLicenseAnalytics: (license?: LicenseStatus, tsd?: unknown) => {
|
|
|
15
15
|
licenseExpiry: number | undefined;
|
|
16
16
|
trialExpiry: number | undefined;
|
|
17
17
|
};
|
|
18
|
+
type Row = [label: string, value: string];
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
+
* What the license box says: a headline, the facts as aligned rows ("Licensed to acme"), and links on their own
|
|
21
|
+
* rows, so it can be read at a glance. `text` is the box's content without colours.
|
|
20
22
|
*/
|
|
21
|
-
|
|
23
|
+
type LicenseStatusMessage = {
|
|
22
24
|
title: string;
|
|
23
|
-
color:
|
|
25
|
+
color: 'green' | 'yellow';
|
|
26
|
+
headline: string;
|
|
27
|
+
rows: Row[];
|
|
28
|
+
links: Row[];
|
|
24
29
|
text: string;
|
|
25
|
-
}
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The license (or trial) box for the terminal. Undefined when there's nothing to show.
|
|
33
|
+
*/
|
|
34
|
+
declare const getLicenseStatusMessage: (license: LicenseStatus, tsd: unknown, now?: number) => LicenseStatusMessage | undefined;
|
|
26
35
|
declare const printLicenseStatus: (license: LicenseStatus, tsd: unknown) => void;
|
|
27
36
|
|
|
28
|
-
export { LicenseStatus, getLicenseAnalytics, getLicenseStatus, getLicenseStatusMessage, printLicenseStatus };
|
|
37
|
+
export { LicenseStatus, type LicenseStatusMessage, getLicenseAnalytics, getLicenseStatus, getLicenseStatusMessage, printLicenseStatus };
|
|
@@ -27,6 +27,8 @@ import expressiveCode from 'astro-expressive-code';
|
|
|
27
27
|
// preprocessors and the rehype plugin below load those same package defaults.
|
|
28
28
|
import expressiveCodeConfig from './ec.config.mjs';
|
|
29
29
|
import ecstudioWatcher from './integrations/ecstudio-watcher.mjs';
|
|
30
|
+
import storage from './integrations/storage.mjs';
|
|
31
|
+
import studioServer from './integrations/studio-server.mjs';
|
|
30
32
|
import eventCatalogIntegration from './src/features/integrations/eventcatalog-features.ts';
|
|
31
33
|
import eventCatalogRuntime, { getDevServerFileSystem, packageDirectory } from './integrations/eventcatalog-runtime.mjs';
|
|
32
34
|
import config from './src/utils/eventcatalog-config/source.ts';
|
|
@@ -139,6 +141,9 @@ export default defineConfig({
|
|
|
139
141
|
catalogAssets({ projectDirectory, generatedDirectory: join(runtimeDirectory, 'public') }),
|
|
140
142
|
effectiveOutput !== 'server' && compress && (await loadAstroCompressIntegration(projectDirectory)),
|
|
141
143
|
ecstudioWatcher(),
|
|
144
|
+
// Before Studio: its database is opened and migrated first
|
|
145
|
+
storage(),
|
|
146
|
+
studioServer(),
|
|
142
147
|
eventCatalogIntegration(),
|
|
143
148
|
linkValidation(config.linkValidation),
|
|
144
149
|
].filter(Boolean),
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { startStorage } from '../src/features/storage/database.ts';
|
|
2
|
+
|
|
3
|
+
// The state EventCatalog keeps (`storage` in eventcatalog.config.js): as the dev server starts, its database is opened
|
|
4
|
+
// and brought up to date (migrated), whether or not a feature that uses it is opened. `eventcatalog start` does the
|
|
5
|
+
// same through /_eventcatalog/start.
|
|
6
|
+
export default function storage() {
|
|
7
|
+
return {
|
|
8
|
+
name: 'eventcatalog-storage',
|
|
9
|
+
hooks: {
|
|
10
|
+
'astro:server:setup': async ({ logger }) => {
|
|
11
|
+
try {
|
|
12
|
+
const file = await startStorage();
|
|
13
|
+
if (file) logger.info(`Database ready (${file})`);
|
|
14
|
+
} catch (error) {
|
|
15
|
+
logger.error(`Could not open the database: ${error.message}`);
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { getStudioRuntime } from '../src/features/studio/server/runtime.ts';
|
|
2
|
+
import { isDatabaseTooNew } from '../src/features/storage/migrations.ts';
|
|
3
|
+
import config from '../src/utils/eventcatalog-config/source.ts';
|
|
4
|
+
import { isCanvasEnabled } from '../src/utils/feature.ts';
|
|
5
|
+
|
|
6
|
+
// Collaborative canvases: the collaboration WebSocket (Yjs over Hocuspocus), on the dev server's port.
|
|
7
|
+
// The runtime is shared with server code (e.g. MCP tools) through globalThis.
|
|
8
|
+
export default function studioServer() {
|
|
9
|
+
return {
|
|
10
|
+
name: 'eventcatalog-studio-server',
|
|
11
|
+
hooks: {
|
|
12
|
+
'astro:server:setup': async ({ server, logger }) => {
|
|
13
|
+
if (!isCanvasEnabled() || !server.httpServer) return;
|
|
14
|
+
const runtime = getStudioRuntime();
|
|
15
|
+
const projectDirectory = process.env.PROJECT_DIR || process.cwd();
|
|
16
|
+
// Canvases are loaded from storage before anyone can open one
|
|
17
|
+
try {
|
|
18
|
+
await runtime.useStorage(config.storage, projectDirectory);
|
|
19
|
+
} catch (error) {
|
|
20
|
+
// Not kept in memory instead (changes would quietly stop being saved): Studio's pages say why
|
|
21
|
+
if (isDatabaseTooNew(error)) return logger.error(`Studio isn't available: ${error.message}`);
|
|
22
|
+
logger.error(`Could not use the Studio storage configured, keeping canvases in memory: ${error.message}`);
|
|
23
|
+
await runtime.useStorage({ type: 'memory' }, projectDirectory);
|
|
24
|
+
}
|
|
25
|
+
runtime.attach(server.httpServer);
|
|
26
|
+
const { type, location } = runtime.storage;
|
|
27
|
+
const kept = type === 'memory' ? 'kept in memory until the server restarts' : `stored in ${location}`;
|
|
28
|
+
logger.info(`Collaboration server ready at /_eventcatalog/studio (canvases ${kept})`);
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|