@eventcatalog/core 3.26.14 → 3.26.16

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.
@@ -37,7 +37,7 @@ var import_axios = __toESM(require("axios"), 1);
37
37
  var import_os = __toESM(require("os"), 1);
38
38
 
39
39
  // package.json
40
- var version = "3.26.14";
40
+ var version = "3.26.16";
41
41
 
42
42
  // src/constants.ts
43
43
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-O4MO7NDQ.js";
4
- import "../chunk-AUSHGY4E.js";
3
+ } from "../chunk-3CPDUB6E.js";
4
+ import "../chunk-LKJCBJX3.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -111,7 +111,7 @@ var import_axios = __toESM(require("axios"), 1);
111
111
  var import_os = __toESM(require("os"), 1);
112
112
 
113
113
  // package.json
114
- var version = "3.26.14";
114
+ var version = "3.26.16";
115
115
 
116
116
  // src/constants.ts
117
117
  var VERSION = version;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-7DFRN6DM.js";
4
- import "../chunk-O4MO7NDQ.js";
3
+ } from "../chunk-E27MVTFI.js";
4
+ import "../chunk-3CPDUB6E.js";
5
5
  import "../chunk-4UVFXLPI.js";
6
- import "../chunk-AUSHGY4E.js";
6
+ import "../chunk-LKJCBJX3.js";
7
7
  import "../chunk-5T63CXKU.js";
8
8
  export {
9
9
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-AUSHGY4E.js";
3
+ } from "./chunk-LKJCBJX3.js";
4
4
 
5
5
  // src/utils/cli-logger.ts
6
6
  import pc from "picocolors";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-AUSHGY4E.js";
3
+ } from "./chunk-LKJCBJX3.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-O4MO7NDQ.js";
3
+ } from "./chunk-3CPDUB6E.js";
4
4
  import {
5
5
  countResources,
6
6
  serializeCounts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-55E4BFOL.js";
3
+ } from "./chunk-232PH27E.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "3.26.14";
2
+ var version = "3.26.16";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "3.26.14";
28
+ var version = "3.26.16";
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-AUSHGY4E.js";
3
+ } from "./chunk-LKJCBJX3.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -114,7 +114,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
114
114
  var import_picocolors = __toESM(require("picocolors"), 1);
115
115
 
116
116
  // package.json
117
- var version = "3.26.14";
117
+ var version = "3.26.16";
118
118
 
119
119
  // src/constants.ts
120
120
  var VERSION = version;
@@ -6,8 +6,8 @@ import {
6
6
  } from "./chunk-PLNJC7NZ.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-7DFRN6DM.js";
10
- import "./chunk-O4MO7NDQ.js";
9
+ } from "./chunk-E27MVTFI.js";
10
+ import "./chunk-3CPDUB6E.js";
11
11
  import "./chunk-4UVFXLPI.js";
12
12
  import {
13
13
  runMigrations
@@ -22,13 +22,13 @@ import {
22
22
  } from "./chunk-3KXCGYET.js";
23
23
  import {
24
24
  generate
25
- } from "./chunk-SAH3W5ID.js";
25
+ } from "./chunk-IYV3DBOW.js";
26
26
  import {
27
27
  logger
28
- } from "./chunk-55E4BFOL.js";
28
+ } from "./chunk-232PH27E.js";
29
29
  import {
30
30
  VERSION
31
- } from "./chunk-AUSHGY4E.js";
31
+ } from "./chunk-LKJCBJX3.js";
32
32
  import {
33
33
  getEventCatalogConfigFile,
34
34
  verifyRequiredFieldsAreInCatalogConfigFile
package/dist/generate.cjs CHANGED
@@ -78,7 +78,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
78
78
  var import_picocolors = __toESM(require("picocolors"), 1);
79
79
 
80
80
  // package.json
81
- var version = "3.26.14";
81
+ var version = "3.26.16";
82
82
 
83
83
  // src/constants.ts
84
84
  var VERSION = version;
package/dist/generate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-SAH3W5ID.js";
4
- import "./chunk-55E4BFOL.js";
5
- import "./chunk-AUSHGY4E.js";
3
+ } from "./chunk-IYV3DBOW.js";
4
+ import "./chunk-232PH27E.js";
5
+ import "./chunk-LKJCBJX3.js";
6
6
  import "./chunk-5T63CXKU.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 = "3.26.14";
39
+ var version = "3.26.16";
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-55E4BFOL.js";
4
- import "../chunk-AUSHGY4E.js";
3
+ } from "../chunk-232PH27E.js";
4
+ import "../chunk-LKJCBJX3.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -85,7 +85,47 @@ if (isRemote && Object.keys(resolvedHeaders).length > 0) {
85
85
  }
86
86
 
87
87
  const parsed = await new Parser({ schemaParsers: [AvroSchemaParser()] }).parse(content, parserOptions);
88
- const stringified = parsed.document?.json();
88
+
89
+ /**
90
+ * The AsyncAPI parser resolves all $ref pointers, which can create circular
91
+ * object references (e.g. oneOf/allOf discriminator patterns where child schemas
92
+ * reference the parent). We need to break true cycles before Astro's
93
+ * `define:vars` calls JSON.stringify internally.
94
+ *
95
+ * We track ancestors (not all-ever-seen objects) so that shared but
96
+ * non-circular references are preserved intact.
97
+ * See: https://github.com/event-catalog/generators/issues/364
98
+ */
99
+ const deepCopyBreakingCycles = (value: unknown, ancestors = new WeakSet()): unknown => {
100
+ if (typeof value !== 'object' || value === null) return value;
101
+
102
+ if (ancestors.has(value)) {
103
+ const schemaId = (value as Record<string, unknown>)['x-parser-schema-id'];
104
+ if (schemaId && typeof schemaId === 'string') {
105
+ return { $ref: `#/components/schemas/${schemaId}` };
106
+ }
107
+ return { $ref: '#' };
108
+ }
109
+
110
+ ancestors.add(value);
111
+
112
+ let result: unknown;
113
+ if (Array.isArray(value)) {
114
+ result = value.map((item) => deepCopyBreakingCycles(item, ancestors));
115
+ } else {
116
+ const obj: Record<string, unknown> = {};
117
+ for (const [k, v] of Object.entries(value as Record<string, unknown>)) {
118
+ obj[k] = deepCopyBreakingCycles(v, ancestors);
119
+ }
120
+ result = obj;
121
+ }
122
+
123
+ ancestors.delete(value);
124
+ return result;
125
+ };
126
+
127
+ const rawJson = parsed.document?.json();
128
+ const stringified = rawJson ? deepCopyBreakingCycles(rawJson) : undefined;
89
129
  const config: ConfigInterface = { show: { sidebar: true, errors: true } };
90
130
 
91
131
  const component = createElement(AsyncApiComponentWP, { schema: { stringified }, config });
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "license": "SEE LICENSE IN LICENSE",
9
9
  "type": "module",
10
- "version": "3.26.14",
10
+ "version": "3.26.16",
11
11
  "publishConfig": {
12
12
  "access": "public"
13
13
  },
@@ -103,8 +103,8 @@
103
103
  "update-notifier": "^7.3.1",
104
104
  "uuid": "^10.0.0",
105
105
  "zod": "^4.3.6",
106
- "@eventcatalog/linter": "1.0.18",
107
- "@eventcatalog/sdk": "2.18.3",
106
+ "@eventcatalog/linter": "1.0.19",
107
+ "@eventcatalog/sdk": "2.18.4",
108
108
  "@eventcatalog/visualiser": "^3.16.1"
109
109
  },
110
110
  "devDependencies": {