@eventcatalog/core 5.0.0-beta.23 → 5.0.0-beta.25

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.
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(analytics_exports);
36
36
  var import_os = __toESM(require("os"), 1);
37
37
 
38
38
  // package.json
39
- var version = "5.0.0-beta.23";
39
+ var version = "5.0.0-beta.25";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-UEVX7NA7.js";
3
+ } from "../chunk-JHFZ7DQA.js";
4
4
  import "../chunk-CPW6G62V.js";
5
- import "../chunk-PL47QVH5.js";
5
+ import "../chunk-NJT4DIOO.js";
6
6
  export {
7
7
  raiseEvent
8
8
  };
@@ -176,7 +176,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
176
176
  var import_os = __toESM(require("os"), 1);
177
177
 
178
178
  // package.json
179
- var version = "5.0.0-beta.23";
179
+ var version = "5.0.0-beta.25";
180
180
 
181
181
  // src/constants.ts
182
182
  var VERSION = version;
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-BCPFKOYS.js";
3
+ } from "../chunk-LH4Y23DH.js";
4
4
  import "../chunk-AWOO63ME.js";
5
5
  import "../chunk-ZAZHAVKB.js";
6
- import "../chunk-UEVX7NA7.js";
6
+ import "../chunk-JHFZ7DQA.js";
7
7
  import "../chunk-CPW6G62V.js";
8
- import "../chunk-PL47QVH5.js";
8
+ import "../chunk-NJT4DIOO.js";
9
9
  import "../chunk-RFIXKATC.js";
10
10
  export {
11
11
  log_build_default as default
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-CPW6G62V.js";
5
5
  import {
6
6
  VERSION
7
- } from "./chunk-PL47QVH5.js";
7
+ } from "./chunk-NJT4DIOO.js";
8
8
 
9
9
  // src/analytics/analytics.js
10
10
  import os from "os";
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-ZAZHAVKB.js";
9
9
  import {
10
10
  raiseEvent
11
- } from "./chunk-UEVX7NA7.js";
11
+ } from "./chunk-JHFZ7DQA.js";
12
12
  import {
13
13
  TELEMETRY_REQUEST_TIMEOUT_MS,
14
14
  isTelemetryDisabled
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "5.0.0-beta.23";
2
+ var version = "5.0.0-beta.25";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-XM7GHRDU.js";
3
+ } from "./chunk-VH3RYFT7.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-PL47QVH5.js";
3
+ } from "./chunk-NJT4DIOO.js";
4
4
 
5
5
  // src/utils/cli-logger.ts
6
6
  import pc from "picocolors";
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "5.0.0-beta.23";
28
+ var version = "5.0.0-beta.25";
29
29
 
30
30
  // src/constants.ts
31
31
  var VERSION = version;
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-PL47QVH5.js";
3
+ } from "./chunk-NJT4DIOO.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -181,7 +181,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
181
181
  var import_picocolors = __toESM(require("picocolors"), 1);
182
182
 
183
183
  // package.json
184
- var version = "5.0.0-beta.23";
184
+ var version = "5.0.0-beta.25";
185
185
 
186
186
  // src/constants.ts
187
187
  var VERSION = version;
@@ -2975,6 +2975,7 @@ Run npm i @eventcatalog/core to update`;
2975
2975
  // src/eventcatalog.ts
2976
2976
  var currentDir = import_node_path21.default.dirname((0, import_node_url2.fileURLToPath)(importMetaUrl));
2977
2977
  var astroCli = import_node_path21.default.join(import_node_path21.default.dirname((0, import_node_module2.createRequire)(importMetaUrl).resolve("astro/package.json")), "bin/astro.mjs");
2978
+ var ASTRO_IN_FOREGROUND = { ASTRO_DEV_BACKGROUND: "1", ASTRO_PREVIEW_BACKGROUND: "1" };
2978
2979
  var program = new import_commander.Command().version(VERSION);
2979
2980
  var dir = import_node_path21.default.resolve(process.env.PROJECT_DIR || process.cwd());
2980
2981
  var eventCatalogDir = import_node_path21.default.resolve((0, import_node_path20.join)(currentDir, "../eventcatalog/"));
@@ -3297,7 +3298,8 @@ program.command("dev").description("Run development server of EventCatalog").opt
3297
3298
  CATALOG_DIR: core,
3298
3299
  EVENTCATALOG_DEV_MODE: "true",
3299
3300
  IGNORE_BUILD_ARTIFACTS: "true",
3300
- NODE_NO_WARNINGS: "1"
3301
+ NODE_NO_WARNINGS: "1",
3302
+ ...ASTRO_IN_FOREGROUND
3301
3303
  },
3302
3304
  shouldFilterLine: createAstroDevLineFilter(),
3303
3305
  transformLine: replaceAstroReadyVersionLine
@@ -3369,7 +3371,8 @@ var previewCatalog = async ({ command }) => {
3369
3371
  cwd: dir,
3370
3372
  env: {
3371
3373
  PROJECT_DIR: dir,
3372
- CATALOG_DIR: core
3374
+ CATALOG_DIR: core,
3375
+ ...ASTRO_IN_FOREGROUND
3373
3376
  },
3374
3377
  shouldFilterLine: createAstroLineFilter()
3375
3378
  });
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-S5GWAUG5.js";
8
8
  import {
9
9
  log_build_default
10
- } from "./chunk-BCPFKOYS.js";
10
+ } from "./chunk-LH4Y23DH.js";
11
11
  import {
12
12
  getLicenseStatus,
13
13
  printLicenseStatus
@@ -36,10 +36,10 @@ import {
36
36
  } from "./chunk-MDWB5HLO.js";
37
37
  import {
38
38
  generate
39
- } from "./chunk-WTC4GUXU.js";
39
+ } from "./chunk-T2MHDVFI.js";
40
40
  import {
41
41
  logger
42
- } from "./chunk-XM7GHRDU.js";
42
+ } from "./chunk-VH3RYFT7.js";
43
43
  import {
44
44
  resolve_catalog_dependencies_default
45
45
  } from "./chunk-36RYTYT5.js";
@@ -53,7 +53,7 @@ import {
53
53
  import {
54
54
  watch
55
55
  } from "./chunk-U63GDPPY.js";
56
- import "./chunk-UEVX7NA7.js";
56
+ import "./chunk-JHFZ7DQA.js";
57
57
  import "./chunk-CPW6G62V.js";
58
58
  import {
59
59
  getAstroConfigPath
@@ -70,7 +70,7 @@ import {
70
70
  } from "./chunk-LFQJXLHG.js";
71
71
  import {
72
72
  VERSION
73
- } from "./chunk-PL47QVH5.js";
73
+ } from "./chunk-NJT4DIOO.js";
74
74
  import {
75
75
  getEventCatalogConfigFile,
76
76
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -641,6 +641,7 @@ async function buildFieldsIndex(catalogDir, outputDir) {
641
641
  // src/eventcatalog.ts
642
642
  var currentDir = path2.dirname(fileURLToPath(import.meta.url));
643
643
  var astroCli = path2.join(path2.dirname(createRequire(import.meta.url).resolve("astro/package.json")), "bin/astro.mjs");
644
+ var ASTRO_IN_FOREGROUND = { ASTRO_DEV_BACKGROUND: "1", ASTRO_PREVIEW_BACKGROUND: "1" };
644
645
  var program = new Command().version(VERSION);
645
646
  var dir = path2.resolve(process.env.PROJECT_DIR || process.cwd());
646
647
  var eventCatalogDir = path2.resolve(join(currentDir, "../eventcatalog/"));
@@ -963,7 +964,8 @@ program.command("dev").description("Run development server of EventCatalog").opt
963
964
  CATALOG_DIR: core,
964
965
  EVENTCATALOG_DEV_MODE: "true",
965
966
  IGNORE_BUILD_ARTIFACTS: "true",
966
- NODE_NO_WARNINGS: "1"
967
+ NODE_NO_WARNINGS: "1",
968
+ ...ASTRO_IN_FOREGROUND
967
969
  },
968
970
  shouldFilterLine: createAstroDevLineFilter(),
969
971
  transformLine: replaceAstroReadyVersionLine
@@ -1035,7 +1037,8 @@ var previewCatalog = async ({ command }) => {
1035
1037
  cwd: dir,
1036
1038
  env: {
1037
1039
  PROJECT_DIR: dir,
1038
- CATALOG_DIR: core
1040
+ CATALOG_DIR: core,
1041
+ ...ASTRO_IN_FOREGROUND
1039
1042
  },
1040
1043
  shouldFilterLine: createAstroLineFilter()
1041
1044
  });
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.23";
115
+ var version = "5.0.0-beta.25";
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-WTC4GUXU.js";
4
- import "./chunk-XM7GHRDU.js";
5
- import "./chunk-PL47QVH5.js";
3
+ } from "./chunk-T2MHDVFI.js";
4
+ import "./chunk-VH3RYFT7.js";
5
+ import "./chunk-NJT4DIOO.js";
6
6
  import "./chunk-RFIXKATC.js";
7
7
  export {
8
8
  generate
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(cli_logger_exports);
36
36
  var import_picocolors = __toESM(require("picocolors"), 1);
37
37
 
38
38
  // package.json
39
- var version = "5.0.0-beta.23";
39
+ var version = "5.0.0-beta.25";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  logger
3
- } from "../chunk-XM7GHRDU.js";
4
- import "../chunk-PL47QVH5.js";
3
+ } from "../chunk-VH3RYFT7.js";
4
+ import "../chunk-NJT4DIOO.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -1,16 +1,19 @@
1
1
  import type { CollectionTypes } from '@types';
2
2
  import type { CollectionEntry } from 'astro:content';
3
- import path from 'node:path';
4
3
  import { compareVersions, toComparableVersion, versionSatisfiesRange } from './version-compare';
5
4
 
6
5
  // --- FILE PATH HELPERS ---
7
6
 
7
+ // Without node:path: node graph builders that import this module also run in the browser (the Fields Explorer)
8
+ const pathSegments = (filePath: string) => filePath.split(/[\\/]/).filter(Boolean);
9
+ const getBasename = (filePath: string) => pathSegments(filePath).at(-1) ?? '';
10
+
8
11
  /**
9
12
  * Extract the folder name from an Astro collection entry's filePath.
10
13
  * Replaces the expensive SDK getResourceFolderName which globs + reads every file.
11
14
  */
12
15
  export const getFolderNameFromFilePath = (filePath: string): string => {
13
- return path.basename(path.dirname(filePath));
16
+ return pathSegments(filePath).at(-2) ?? '';
14
17
  };
15
18
 
16
19
  // --- SPECIFICATION HELPERS ---
@@ -73,8 +76,9 @@ export const processSpecifications = (
73
76
  return specs.map((spec) => ({
74
77
  ...spec,
75
78
  name: spec.name || getDefaultSpecificationName(spec.type),
76
- filename: path.basename(spec.path),
77
- filenameWithoutExtension: path.basename(spec.path, path.extname(spec.path)),
79
+ filename: getBasename(spec.path),
80
+ // Keeps a leading dot, as path.extname does (`.env` has no extension)
81
+ filenameWithoutExtension: getBasename(spec.path).replace(/(?<=.)\.[^.]*$/, ''),
78
82
  }));
79
83
  };
80
84
 
@@ -1,6 +1,6 @@
1
1
  import type { Node, Edge } from '@xyflow/react';
2
2
  import { createEdge, createNode, buildContextMenuForMessage, buildContextMenuForService } from './utils/utils';
3
- import { layoutNodeGraph } from '@utils/node-graphs/layout-node-graph';
3
+ import { layoutWithElk } from '@eventcatalog/visualiser/layout';
4
4
 
5
5
  export interface FieldOccurrence {
6
6
  messageId: string;
@@ -173,5 +173,7 @@ export const getNodesAndEdges = async ({
173
173
 
174
174
  if (!layout) return { nodes, edges };
175
175
 
176
- return layoutNodeGraph({ nodes, edges });
176
+ // Lays out with ELK directly rather than layoutNodeGraph: this runs in the browser (the Fields Explorer),
177
+ // and layoutNodeGraph's cache reads the catalog's config, which would put the config in the browser's bundle
178
+ return (await layoutWithElk({ nodes, edges })) as unknown as { nodes: Node[]; edges: Edge[] };
177
179
  };
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "license": "BUSL-1.1",
9
9
  "type": "module",
10
- "version": "5.0.0-beta.23",
10
+ "version": "5.0.0-beta.25",
11
11
  "publishConfig": {
12
12
  "access": "public"
13
13
  },
@@ -141,9 +141,9 @@
141
141
  "y-protocols": "^1.0.7",
142
142
  "yjs": "^13.6.33",
143
143
  "zod": "^4.3.6",
144
+ "@eventcatalog/linter": "1.2.0-beta.4",
144
145
  "@eventcatalog/sdk": "2.30.0-beta.1",
145
- "@eventcatalog/visualiser": "^5.0.0-beta.6",
146
- "@eventcatalog/linter": "1.2.0-beta.4"
146
+ "@eventcatalog/visualiser": "^5.0.0-beta.6"
147
147
  },
148
148
  "devDependencies": {
149
149
  "@astrojs/check": "^0.9.10",