@eventcatalog/core 5.0.0-beta.2 → 5.0.0-beta.21
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 +234 -134
- package/README.md +5 -5
- 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/catalog-runtime.cjs +1 -1
- package/dist/{chunk-TQLRG35T.js → chunk-AWOO63ME.js} +71 -45
- package/dist/chunk-CPW6G62V.js +17 -0
- package/dist/{chunk-KIDISU6X.js → chunk-I7F7CPDC.js} +56 -33
- package/dist/{chunk-HGRFXTFC.js → chunk-OVWDUANF.js} +1 -1
- package/dist/{chunk-62EV4IJA.js → chunk-RIRRWE7D.js} +1 -1
- package/dist/chunk-S5GWAUG5.js +29 -0
- package/dist/{chunk-4J2ZM2HX.js → chunk-W6KDW6ZC.js} +1 -1
- package/dist/{chunk-XARPIXWF.js → chunk-WHYRRLHE.js} +9 -3
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +245 -131
- package/dist/eventcatalog.config.d.cts +59 -1
- package/dist/eventcatalog.config.d.ts +59 -1
- package/dist/eventcatalog.js +45 -15
- package/dist/federation/federate.js +2 -2
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/runtime-dependencies/@eventcatalog__visualiser__studio-fonts.css.mjs +3 -0
- package/dist/runtime-dependencies/@eventcatalog__visualiser__studio.css.mjs +3 -0
- package/dist/runtime-dependencies/@eventcatalog__visualiser__studio.mjs +3 -0
- 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/htmlparser2.mjs +3 -0
- package/dist/runtime-dependencies/manifest.json +13 -1
- package/dist/runtime-dependencies/react-hotkeys-hook.mjs +3 -0
- package/dist/runtime-dependencies/react-syntax-highlighter__dist__cjs__create-element.js.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/child-process-signals.cjs +53 -0
- package/dist/utils/child-process-signals.d.cts +19 -0
- package/dist/utils/child-process-signals.d.ts +19 -0
- package/dist/utils/child-process-signals.js +6 -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 +23 -1
- package/eventcatalog/integrations/skip-startup-reload.mjs +31 -0
- package/eventcatalog/integrations/stable-dependency-order.mjs +29 -0
- package/eventcatalog/integrations/storage.mjs +20 -0
- package/eventcatalog/integrations/studio-server.mjs +32 -0
- package/eventcatalog/src/components/CatalogGraph/CatalogForceGraph.tsx +39 -0
- package/eventcatalog/src/components/ChatPanel/ChatPanel.tsx +2 -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/MDX/NodeGraph/AstroNodeGraph.tsx +42 -3
- package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.astro +5 -1
- package/eventcatalog/src/components/NavigationProgress.astro +7 -0
- package/eventcatalog/src/components/SchemaExplorer/ApiContentViewer.tsx +2 -0
- package/eventcatalog/src/components/SchemaExplorer/ExamplesViewer.tsx +2 -0
- package/eventcatalog/src/components/SchemaExplorer/SchemaCodeModal.tsx +2 -0
- package/eventcatalog/src/components/SchemaExplorer/SchemaContentViewer.tsx +2 -0
- package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsPanel.tsx +12 -4
- package/eventcatalog/src/components/Search/SearchDataLoader.astro +16 -28
- package/eventcatalog/src/components/Search/SearchModal.tsx +2 -10
- package/eventcatalog/src/components/Search/search-utils.ts +26 -0
- package/eventcatalog/src/components/Seo.astro +5 -1
- package/eventcatalog/src/components/SideNav/NestedSideBar/index.tsx +53 -83
- package/eventcatalog/src/components/SideNav/NestedSideBar/storage.ts +2 -0
- package/eventcatalog/src/components/SideNav/NestedSideBar/utils.ts +131 -0
- package/eventcatalog/src/components/SideNav/SideNav.astro +9 -1
- 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/error.astro +4 -2
- package/eventcatalog/src/features/auth/login.astro +2 -1
- package/eventcatalog/src/features/auth/middleware/middleware-auth.ts +10 -0
- package/eventcatalog/src/features/auth/unauthorized.astro +1 -1
- package/eventcatalog/src/features/fields/pages/fields.astro +1 -1
- package/eventcatalog/src/features/integrations/eventcatalog-features.ts +34 -1
- package/eventcatalog/src/features/mcp/apps/architecture-diagram/node-chat.tsx +6 -45
- package/eventcatalog/src/features/mcp/apps/canvas/shared.ts +47 -0
- package/eventcatalog/src/features/mcp/apps/canvas/styles.css +24 -0
- package/eventcatalog/src/features/mcp/apps/canvas/view.tsx +278 -0
- package/eventcatalog/src/features/mcp/apps/generated/canvas.html +272 -0
- package/eventcatalog/src/features/mcp/apps/generated/viewer.html +77 -76
- 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 +384 -0
- package/eventcatalog/src/features/studio/agents.ts +28 -0
- package/eventcatalog/src/features/studio/api/canvases-api.ts +219 -0
- package/eventcatalog/src/features/studio/api/canvases.ts +25 -0
- package/eventcatalog/src/features/studio/api/client.ts +40 -0
- package/eventcatalog/src/features/studio/canvas-actions.ts +540 -0
- package/eventcatalog/src/features/studio/canvas-preview.ts +52 -0
- package/eventcatalog/src/features/studio/catalog-resources.ts +155 -0
- package/eventcatalog/src/features/studio/catalog.ts +173 -0
- package/eventcatalog/src/features/studio/components/CanvasHeader.tsx +518 -0
- package/eventcatalog/src/features/studio/components/CanvasStatusMenu.tsx +118 -0
- package/eventcatalog/src/features/studio/components/ConnectAgentDialog.tsx +434 -0
- package/eventcatalog/src/features/studio/components/ConnectionsChooser.tsx +143 -0
- package/eventcatalog/src/features/studio/components/DeleteCanvasDialog.tsx +65 -0
- package/eventcatalog/src/features/studio/components/Dialog.tsx +60 -0
- package/eventcatalog/src/features/studio/components/JoinForm.tsx +109 -0
- package/eventcatalog/src/features/studio/components/LeftPanel.tsx +203 -0
- package/eventcatalog/src/features/studio/components/NodeDetails.tsx +183 -0
- package/eventcatalog/src/features/studio/components/OpenInStudioDialog.tsx +79 -0
- package/eventcatalog/src/features/studio/components/Presence.tsx +293 -0
- package/eventcatalog/src/features/studio/components/ShareDialog.tsx +396 -0
- package/eventcatalog/src/features/studio/components/ShortcutsDialog.tsx +41 -0
- package/eventcatalog/src/features/studio/components/StudioDesigner.tsx +2091 -0
- package/eventcatalog/src/features/studio/components/StudioNotice.astro +24 -0
- package/eventcatalog/src/features/studio/document-name.ts +7 -0
- package/eventcatalog/src/features/studio/from-visualiser.ts +138 -0
- package/eventcatalog/src/features/studio/hooks/presence-sender.ts +63 -0
- package/eventcatalog/src/features/studio/hooks/presence-store.ts +119 -0
- package/eventcatalog/src/features/studio/hooks/use-canvas-webmcp.ts +353 -0
- package/eventcatalog/src/features/studio/hooks/use-comments.ts +54 -0
- package/eventcatalog/src/features/studio/hooks/use-follow-camera.ts +109 -0
- package/eventcatalog/src/features/studio/hooks/use-studio-flow.ts +782 -0
- package/eventcatalog/src/features/studio/identity.ts +59 -0
- package/eventcatalog/src/features/studio/limits.ts +2 -0
- package/eventcatalog/src/features/studio/pages/[id].astro +69 -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/server/canvas-mcp.ts +495 -0
- package/eventcatalog/src/features/studio/server/runtime.ts +498 -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/tool-sync.ts +75 -0
- package/eventcatalog/src/layouts/BaseLayout.astro +4 -4
- package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +13 -7
- package/eventcatalog/src/pages/_index.astro +1 -1
- 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/[type]/[id]/index.astro +1 -1
- package/eventcatalog/src/pages/docs/services/[id]/[version]/resources/index.astro +13 -0
- package/eventcatalog/src/pages/index.astro +1 -1
- package/eventcatalog/src/pages/schemas/explorer/index.astro +1 -1
- package/eventcatalog/src/pages/visualiser/[type]/[id]/index.astro +1 -1
- 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/types/react-syntax-highlighter.d.ts +10 -0
- 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/link-validation.ts +25 -19
- package/eventcatalog/src/utils/node-graphs/domain-entity-map.ts +3 -1
- package/eventcatalog/src/utils/node-graphs/domain-levels-node-graph.ts +3 -3
- package/eventcatalog/src/utils/node-graphs/export-mermaid.ts +0 -2
- package/eventcatalog/src/utils/node-graphs/layout-node-graph.ts +20 -1
- package/eventcatalog/src/utils/node-graphs/node-resource.ts +67 -0
- package/eventcatalog/src/utils/node-graphs/systems-node-graph.ts +1 -1
- package/eventcatalog/src/utils/page-title.ts +15 -0
- package/eventcatalog/src/utils/syntax-highlighter-renderer.ts +64 -0
- package/eventcatalog/src/utils/trial.ts +1 -1
- package/package.json +22 -16
- 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 };
|
|
@@ -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
|
@@ -2,19 +2,23 @@ import {
|
|
|
2
2
|
runMigrations
|
|
3
3
|
} from "./chunk-XUAF2H54.js";
|
|
4
4
|
import "./chunk-CA4U2JP7.js";
|
|
5
|
+
import {
|
|
6
|
+
stopChildWithParent
|
|
7
|
+
} from "./chunk-S5GWAUG5.js";
|
|
5
8
|
import {
|
|
6
9
|
log_build_default
|
|
7
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-I7F7CPDC.js";
|
|
8
11
|
import {
|
|
9
12
|
getLicenseStatus,
|
|
10
13
|
printLicenseStatus
|
|
11
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-AWOO63ME.js";
|
|
12
15
|
import "./chunk-ZAZHAVKB.js";
|
|
13
16
|
import {
|
|
14
17
|
FederationConflictError,
|
|
15
18
|
FederationDiagnosticError,
|
|
16
19
|
federateCatalog
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-KHACCTW2.js";
|
|
21
|
+
import "./chunk-WRNH5C3U.js";
|
|
18
22
|
import "./chunk-5EPNFDT5.js";
|
|
19
23
|
import "./chunk-A2RZR3U4.js";
|
|
20
24
|
import "./chunk-R7Z5ALYI.js";
|
|
@@ -24,7 +28,6 @@ import {
|
|
|
24
28
|
} from "./chunk-JJPB6EOZ.js";
|
|
25
29
|
import "./chunk-SDZQJTJW.js";
|
|
26
30
|
import "./chunk-352FGP6W.js";
|
|
27
|
-
import "./chunk-WRNH5C3U.js";
|
|
28
31
|
import {
|
|
29
32
|
getProjectOutDir,
|
|
30
33
|
isAuthEnabled,
|
|
@@ -33,10 +36,10 @@ import {
|
|
|
33
36
|
} from "./chunk-MDWB5HLO.js";
|
|
34
37
|
import {
|
|
35
38
|
generate
|
|
36
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-OVWDUANF.js";
|
|
37
40
|
import {
|
|
38
41
|
logger
|
|
39
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-W6KDW6ZC.js";
|
|
40
43
|
import {
|
|
41
44
|
resolve_catalog_dependencies_default
|
|
42
45
|
} from "./chunk-36RYTYT5.js";
|
|
@@ -50,7 +53,8 @@ import {
|
|
|
50
53
|
import {
|
|
51
54
|
watch
|
|
52
55
|
} from "./chunk-U63GDPPY.js";
|
|
53
|
-
import "./chunk-
|
|
56
|
+
import "./chunk-WHYRRLHE.js";
|
|
57
|
+
import "./chunk-CPW6G62V.js";
|
|
54
58
|
import {
|
|
55
59
|
getAstroConfigPath
|
|
56
60
|
} from "./chunk-VIJJ7JKH.js";
|
|
@@ -66,7 +70,7 @@ import {
|
|
|
66
70
|
} from "./chunk-LFQJXLHG.js";
|
|
67
71
|
import {
|
|
68
72
|
VERSION
|
|
69
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-RIRRWE7D.js";
|
|
70
74
|
import {
|
|
71
75
|
getEventCatalogConfigFile,
|
|
72
76
|
verifyRequiredFieldsAreInCatalogConfigFile
|
|
@@ -79,7 +83,7 @@ import { join } from "path";
|
|
|
79
83
|
import http from "http";
|
|
80
84
|
import fs3 from "fs";
|
|
81
85
|
import path2 from "path";
|
|
82
|
-
import { fileURLToPath } from "url";
|
|
86
|
+
import { fileURLToPath, pathToFileURL } from "url";
|
|
83
87
|
import { createRequire } from "module";
|
|
84
88
|
import boxen from "boxen";
|
|
85
89
|
import updateNotifier from "update-notifier";
|
|
@@ -668,7 +672,7 @@ var resolveDevPort = async ({ projectDir }) => {
|
|
|
668
672
|
};
|
|
669
673
|
var startDevPrewarm = ({
|
|
670
674
|
port = 3e3,
|
|
671
|
-
paths = ["/
|
|
675
|
+
paths = ["/"],
|
|
672
676
|
retries = 80,
|
|
673
677
|
intervalMs = 250,
|
|
674
678
|
initialDelayMs = 500
|
|
@@ -677,10 +681,13 @@ var startDevPrewarm = ({
|
|
|
677
681
|
const hit = (requestPath) => new Promise((resolve) => {
|
|
678
682
|
const req = http.get(
|
|
679
683
|
{
|
|
680
|
-
|
|
684
|
+
// Not 127.0.0.1: the dev server can listen on IPv6 only ([::1]), which refused
|
|
685
|
+
// every prewarm request
|
|
686
|
+
hostname: "localhost",
|
|
681
687
|
port,
|
|
682
688
|
path: requestPath,
|
|
683
|
-
|
|
689
|
+
// A refused connection fails at once; once connected, let the first render finish
|
|
690
|
+
timeout: 3e4
|
|
684
691
|
},
|
|
685
692
|
(res) => {
|
|
686
693
|
res.resume();
|
|
@@ -782,6 +789,7 @@ var runCommandWithFilteredOutput = async ({
|
|
|
782
789
|
},
|
|
783
790
|
stdio: ["inherit", "pipe", "pipe"]
|
|
784
791
|
});
|
|
792
|
+
const signals = stopChildWithParent(child);
|
|
785
793
|
let stdoutBuffer = "";
|
|
786
794
|
let stderrBuffer = "";
|
|
787
795
|
const flush = (buffer, writer, isFinal = false) => {
|
|
@@ -809,11 +817,13 @@ var runCommandWithFilteredOutput = async ({
|
|
|
809
817
|
stderrBuffer = flush(stderrBuffer, process.stderr);
|
|
810
818
|
});
|
|
811
819
|
child.on("error", (error) => {
|
|
820
|
+
signals.childClosed();
|
|
812
821
|
reject(error);
|
|
813
822
|
});
|
|
814
823
|
child.on("close", (code) => {
|
|
815
824
|
stdoutBuffer = flush(stdoutBuffer, process.stdout, true);
|
|
816
825
|
stderrBuffer = flush(stderrBuffer, process.stderr, true);
|
|
826
|
+
if (signals.childClosed()) return;
|
|
817
827
|
if (code === 0) {
|
|
818
828
|
resolve();
|
|
819
829
|
return;
|
|
@@ -939,7 +949,9 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
939
949
|
});
|
|
940
950
|
startDevPrewarm({
|
|
941
951
|
port: prewarmPort,
|
|
942
|
-
|
|
952
|
+
// Renders the homepage before anyone opens it. Requests stop at the first response,
|
|
953
|
+
// so a probe path like /ping first would leave the homepage cold.
|
|
954
|
+
paths: ["/"]
|
|
943
955
|
});
|
|
944
956
|
}
|
|
945
957
|
await runCommandWithFilteredOutput({
|
|
@@ -1028,15 +1040,33 @@ var previewCatalog = async ({ command }) => {
|
|
|
1028
1040
|
shouldFilterLine: createAstroLineFilter()
|
|
1029
1041
|
});
|
|
1030
1042
|
};
|
|
1043
|
+
var SERVER_BOOTSTRAP = `
|
|
1044
|
+
const entry = await import(process.argv[1]);
|
|
1045
|
+
const { server } = entry.startServer();
|
|
1046
|
+
globalThis[Symbol.for('eventcatalog.http-server')] = server.server;
|
|
1047
|
+
const start = process.env.EVENTCATALOG_START_PATH;
|
|
1048
|
+
if (start) {
|
|
1049
|
+
server.server.once('listening', () => {
|
|
1050
|
+
// Where the server listens (HOST can be one address only); loopback when it listens on every address
|
|
1051
|
+
const { address, port } = server.server.address();
|
|
1052
|
+
const host = ['0.0.0.0', '::'].includes(address) ? '127.0.0.1' : address.includes(':') ? '[' + address + ']' : address;
|
|
1053
|
+
fetch('http://' + host + ':' + port + start).catch((error) => console.error('[eventcatalog] Could not start the server:', error.message));
|
|
1054
|
+
});
|
|
1055
|
+
}
|
|
1056
|
+
`;
|
|
1031
1057
|
var startServerCatalog = async () => {
|
|
1032
1058
|
const serverEntryPath = path2.join(dir, "dist", "server", "entry.mjs");
|
|
1059
|
+
const config = await getEventCatalogConfigFile(dir);
|
|
1060
|
+
const base = (config?.base || "/").replace(/\/$/, "");
|
|
1033
1061
|
await runCommandWithFilteredOutput({
|
|
1034
1062
|
command: process.execPath,
|
|
1035
|
-
args: [serverEntryPath],
|
|
1063
|
+
args: ["--input-type=module", "-e", SERVER_BOOTSTRAP, pathToFileURL(serverEntryPath).href],
|
|
1036
1064
|
cwd: dir,
|
|
1037
1065
|
env: {
|
|
1038
1066
|
PROJECT_DIR: dir,
|
|
1039
|
-
CATALOG_DIR: core
|
|
1067
|
+
CATALOG_DIR: core,
|
|
1068
|
+
ASTRO_NODE_AUTOSTART: "disabled",
|
|
1069
|
+
EVENTCATALOG_START_PATH: `${base}/_eventcatalog/start`
|
|
1040
1070
|
},
|
|
1041
1071
|
shouldFilterLine: createAstroLineFilter()
|
|
1042
1072
|
});
|
|
@@ -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.21";
|
|
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-OVWDUANF.js";
|
|
4
|
+
import "./chunk-W6KDW6ZC.js";
|
|
5
|
+
import "./chunk-RIRRWE7D.js";
|
|
6
6
|
import "./chunk-RFIXKATC.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
"@eventcatalog/sdk": "@eventcatalog__sdk.mjs",
|
|
22
22
|
"@eventcatalog/visualiser": "@eventcatalog__visualiser.mjs",
|
|
23
23
|
"@eventcatalog/visualiser/layout": "@eventcatalog__visualiser__layout.mjs",
|
|
24
|
+
"@eventcatalog/visualiser/studio": "@eventcatalog__visualiser__studio.mjs",
|
|
25
|
+
"@eventcatalog/visualiser/studio-fonts.css": "@eventcatalog__visualiser__studio-fonts.css.mjs",
|
|
26
|
+
"@eventcatalog/visualiser/studio.css": "@eventcatalog__visualiser__studio.css.mjs",
|
|
24
27
|
"@eventcatalog/visualiser/styles-core.css": "@eventcatalog__visualiser__styles-core.css.mjs",
|
|
25
28
|
"@fontsource/inter": "@fontsource__inter.mjs",
|
|
26
29
|
"@fontsource/inter/400.css": "@fontsource__inter__400.css.mjs",
|
|
@@ -34,7 +37,11 @@
|
|
|
34
37
|
"@heroicons/react/24/outline/RectangleGroupIcon": "@heroicons__react__24__outline__RectangleGroupIcon.mjs",
|
|
35
38
|
"@heroicons/react/24/outline/ServerIcon": "@heroicons__react__24__outline__ServerIcon.mjs",
|
|
36
39
|
"@heroicons/react/24/solid": "@heroicons__react__24__solid.mjs",
|
|
40
|
+
"@hocuspocus/provider": "@hocuspocus__provider.mjs",
|
|
41
|
+
"@hocuspocus/server": "@hocuspocus__server.mjs",
|
|
37
42
|
"@iconify-json/logos": "@iconify-json__logos.mjs",
|
|
43
|
+
"@mcp-b/webmcp-local-relay": "@mcp-b__webmcp-local-relay.mjs",
|
|
44
|
+
"@mcp-b/webmcp-polyfill": "@mcp-b__webmcp-polyfill.mjs",
|
|
38
45
|
"@mermaid-js/layout-elk": "@mermaid-js__layout-elk.mjs",
|
|
39
46
|
"@mermaid-js/layout-elk/dist/mermaid-layout-elk.core.mjs": "@mermaid-js__layout-elk__dist__mermaid-layout-elk.core.mjs.mjs",
|
|
40
47
|
"@modelcontextprotocol/ext-apps": "@modelcontextprotocol__ext-apps.mjs",
|
|
@@ -87,6 +94,7 @@
|
|
|
87
94
|
"gray-matter": "gray-matter.mjs",
|
|
88
95
|
"hono": "hono.mjs",
|
|
89
96
|
"html-to-image": "html-to-image.mjs",
|
|
97
|
+
"htmlparser2": "htmlparser2.mjs",
|
|
90
98
|
"js-yaml": "js-yaml.mjs",
|
|
91
99
|
"jsonpath-plus": "jsonpath-plus.mjs",
|
|
92
100
|
"jsonwebtoken": "jsonwebtoken.mjs",
|
|
@@ -107,8 +115,10 @@
|
|
|
107
115
|
"react-dom": "react-dom.mjs",
|
|
108
116
|
"react-dom/client": "react-dom__client.mjs",
|
|
109
117
|
"react-dom/server": "react-dom__server.mjs",
|
|
118
|
+
"react-hotkeys-hook": "react-hotkeys-hook.mjs",
|
|
110
119
|
"react-markdown": "react-markdown.mjs",
|
|
111
120
|
"react-syntax-highlighter": "react-syntax-highlighter.mjs",
|
|
121
|
+
"react-syntax-highlighter/dist/cjs/create-element.js": "react-syntax-highlighter__dist__cjs__create-element.js.mjs",
|
|
112
122
|
"react-syntax-highlighter/dist/cjs/styles/prism": "react-syntax-highlighter__dist__cjs__styles__prism.mjs",
|
|
113
123
|
"react-syntax-highlighter/dist/cjs/styles/prism/index.js": "react-syntax-highlighter__dist__cjs__styles__prism__index.js.mjs",
|
|
114
124
|
"react-syntax-highlighter/dist/esm/languages/prism/graphql": "react-syntax-highlighter__dist__esm__languages__prism__graphql.mjs",
|
|
@@ -132,7 +142,6 @@
|
|
|
132
142
|
"rimraf": "rimraf.mjs",
|
|
133
143
|
"semver": "semver.mjs",
|
|
134
144
|
"set-cookie-parser": "set-cookie-parser.mjs",
|
|
135
|
-
"shelljs": "shelljs.mjs",
|
|
136
145
|
"sonner": "sonner.mjs",
|
|
137
146
|
"sql.js": "sql.js.mjs",
|
|
138
147
|
"tailwindcss": "tailwindcss.mjs",
|
|
@@ -140,6 +149,9 @@
|
|
|
140
149
|
"unist-util-visit": "unist-util-visit.mjs",
|
|
141
150
|
"update-notifier": "update-notifier.mjs",
|
|
142
151
|
"uuid": "uuid.mjs",
|
|
152
|
+
"y-protocols": "y-protocols.mjs",
|
|
153
|
+
"y-protocols/awareness": "y-protocols__awareness.mjs",
|
|
154
|
+
"yjs": "yjs.mjs",
|
|
143
155
|
"zod": "zod.mjs",
|
|
144
156
|
"zod/v4": "zod__v4.mjs"
|
|
145
157
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/utils/child-process-signals.ts
|
|
21
|
+
var child_process_signals_exports = {};
|
|
22
|
+
__export(child_process_signals_exports, {
|
|
23
|
+
stopChildWithParent: () => stopChildWithParent
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(child_process_signals_exports);
|
|
26
|
+
var import_node_os = require("os");
|
|
27
|
+
var FORWARDED_SIGNALS = ["SIGINT", "SIGTERM", "SIGHUP"];
|
|
28
|
+
var isRunning = (child) => child.exitCode === null && child.signalCode === null;
|
|
29
|
+
var stopChildWithParent = (child, parent = process) => {
|
|
30
|
+
let received;
|
|
31
|
+
const onSignal = (signal) => {
|
|
32
|
+
received = signal;
|
|
33
|
+
if (isRunning(child)) child.kill(signal);
|
|
34
|
+
};
|
|
35
|
+
const onExit = () => {
|
|
36
|
+
if (isRunning(child)) child.kill("SIGTERM");
|
|
37
|
+
};
|
|
38
|
+
for (const signal of FORWARDED_SIGNALS) parent.on(signal, onSignal);
|
|
39
|
+
parent.on("exit", onExit);
|
|
40
|
+
return {
|
|
41
|
+
childClosed: () => {
|
|
42
|
+
for (const signal of FORWARDED_SIGNALS) parent.off(signal, onSignal);
|
|
43
|
+
parent.off("exit", onExit);
|
|
44
|
+
if (!received) return false;
|
|
45
|
+
parent.exit(128 + import_node_os.constants.signals[received]);
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
51
|
+
0 && (module.exports = {
|
|
52
|
+
stopChildWithParent
|
|
53
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ChildProcess } from 'node:child_process';
|
|
2
|
+
|
|
3
|
+
type Child = Pick<ChildProcess, 'kill' | 'exitCode' | 'signalCode'>;
|
|
4
|
+
type Parent = Pick<NodeJS.Process, 'on' | 'off' | 'exit'>;
|
|
5
|
+
/**
|
|
6
|
+
* Stops a child process along with the CLI. Without this, `kill` or a container stopping the CLI
|
|
7
|
+
* stopped the CLI only: its child (e.g. the server `eventcatalog start` runs) kept running and holding
|
|
8
|
+
* its port. A signal the CLI receives is passed to the child, which can finish what it's doing; the
|
|
9
|
+
* CLI then exits as the signal would have stopped it (128 + the signal's number). It exits explicitly
|
|
10
|
+
* rather than raising the signal again, which a container's first process (PID 1) would ignore.
|
|
11
|
+
*
|
|
12
|
+
* Call `childClosed` once the child has closed: it returns true when the CLI is exiting because of a
|
|
13
|
+
* signal, so the caller shouldn't report the child's exit as a failure.
|
|
14
|
+
*/
|
|
15
|
+
declare const stopChildWithParent: (child: Child, parent?: Parent) => {
|
|
16
|
+
childClosed: () => boolean;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { stopChildWithParent };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ChildProcess } from 'node:child_process';
|
|
2
|
+
|
|
3
|
+
type Child = Pick<ChildProcess, 'kill' | 'exitCode' | 'signalCode'>;
|
|
4
|
+
type Parent = Pick<NodeJS.Process, 'on' | 'off' | 'exit'>;
|
|
5
|
+
/**
|
|
6
|
+
* Stops a child process along with the CLI. Without this, `kill` or a container stopping the CLI
|
|
7
|
+
* stopped the CLI only: its child (e.g. the server `eventcatalog start` runs) kept running and holding
|
|
8
|
+
* its port. A signal the CLI receives is passed to the child, which can finish what it's doing; the
|
|
9
|
+
* CLI then exits as the signal would have stopped it (128 + the signal's number). It exits explicitly
|
|
10
|
+
* rather than raising the signal again, which a container's first process (PID 1) would ignore.
|
|
11
|
+
*
|
|
12
|
+
* Call `childClosed` once the child has closed: it returns true when the CLI is exiting because of a
|
|
13
|
+
* signal, so the caller shouldn't report the child's exit as a failure.
|
|
14
|
+
*/
|
|
15
|
+
declare const stopChildWithParent: (child: Child, parent?: Parent) => {
|
|
16
|
+
childClosed: () => boolean;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { stopChildWithParent };
|