@eventcatalog/core 3.26.13 → 3.26.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-4YUQLDIS.js → chunk-3E57V3U3.js} +1 -1
- package/dist/{chunk-FSFVH3VP.js → chunk-76RGT53V.js} +1 -1
- package/dist/{chunk-HIOIWNBV.js → chunk-BBW2CP5O.js} +1 -1
- package/dist/{chunk-2IPEX677.js → chunk-GWXHXBAD.js} +1 -1
- package/dist/{chunk-NN5GG4GM.js → chunk-JIVNOOE7.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +17 -1
- package/dist/eventcatalog.js +21 -5
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/asyncapi/[filename].astro +41 -1
- package/package.json +2 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-BBW2CP5O.js";
|
|
4
|
+
import "../chunk-3E57V3U3.js";
|
|
5
5
|
import "../chunk-4UVFXLPI.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-76RGT53V.js";
|
|
7
7
|
import "../chunk-5T63CXKU.js";
|
|
8
8
|
export {
|
|
9
9
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -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.
|
|
117
|
+
var version = "3.26.15";
|
|
118
118
|
|
|
119
119
|
// src/constants.ts
|
|
120
120
|
var VERSION = version;
|
|
@@ -1655,6 +1655,22 @@ program.command("start").description("Serves the contents of your eventcatalog b
|
|
|
1655
1655
|
});
|
|
1656
1656
|
}
|
|
1657
1657
|
});
|
|
1658
|
+
program.command("export").description("Export your EventCatalog using the SDK dumpCatalog function").option("--include-markdown", "Include markdown content in the export", false).action(async (options) => {
|
|
1659
|
+
logger.welcome();
|
|
1660
|
+
logger.info("Exporting EventCatalog...", "export");
|
|
1661
|
+
if (import_fs2.default.existsSync(import_node_path9.default.join(dir, ".env"))) {
|
|
1662
|
+
import_dotenv.default.config({ path: import_node_path9.default.join(dir, ".env") });
|
|
1663
|
+
}
|
|
1664
|
+
const { default: initSDK } = await import("@eventcatalog/sdk");
|
|
1665
|
+
const sdk = initSDK(dir);
|
|
1666
|
+
const catalog = await sdk.dumpCatalog({ includeMarkdown: options.includeMarkdown });
|
|
1667
|
+
const exportsDir = import_node_path9.default.join(dir, "exports");
|
|
1668
|
+
ensureDir(exportsDir);
|
|
1669
|
+
const date = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
1670
|
+
const exportFile = import_node_path9.default.join(exportsDir, `catalog-${date}.json`);
|
|
1671
|
+
import_fs2.default.writeFileSync(exportFile, JSON.stringify(catalog, null, 2), "utf-8");
|
|
1672
|
+
logger.info(`Catalog exported to ${exportFile}`, "export");
|
|
1673
|
+
});
|
|
1658
1674
|
program.command("generate [siteDir]").description("Start the generator scripts.").action(async () => {
|
|
1659
1675
|
if (import_fs2.default.existsSync(import_node_path9.default.join(dir, ".env"))) {
|
|
1660
1676
|
import_dotenv.default.config({ path: import_node_path9.default.join(dir, ".env") });
|
package/dist/eventcatalog.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "./chunk-PLNJC7NZ.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-BBW2CP5O.js";
|
|
10
|
+
import "./chunk-3E57V3U3.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-
|
|
25
|
+
} from "./chunk-GWXHXBAD.js";
|
|
26
26
|
import {
|
|
27
27
|
logger
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-JIVNOOE7.js";
|
|
29
29
|
import {
|
|
30
30
|
VERSION
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-76RGT53V.js";
|
|
32
32
|
import {
|
|
33
33
|
getEventCatalogConfigFile,
|
|
34
34
|
verifyRequiredFieldsAreInCatalogConfigFile
|
|
@@ -1002,6 +1002,22 @@ program.command("start").description("Serves the contents of your eventcatalog b
|
|
|
1002
1002
|
});
|
|
1003
1003
|
}
|
|
1004
1004
|
});
|
|
1005
|
+
program.command("export").description("Export your EventCatalog using the SDK dumpCatalog function").option("--include-markdown", "Include markdown content in the export", false).action(async (options) => {
|
|
1006
|
+
logger.welcome();
|
|
1007
|
+
logger.info("Exporting EventCatalog...", "export");
|
|
1008
|
+
if (fs3.existsSync(path2.join(dir, ".env"))) {
|
|
1009
|
+
dotenv.config({ path: path2.join(dir, ".env") });
|
|
1010
|
+
}
|
|
1011
|
+
const { default: initSDK } = await import("@eventcatalog/sdk");
|
|
1012
|
+
const sdk = initSDK(dir);
|
|
1013
|
+
const catalog = await sdk.dumpCatalog({ includeMarkdown: options.includeMarkdown });
|
|
1014
|
+
const exportsDir = path2.join(dir, "exports");
|
|
1015
|
+
ensureDir(exportsDir);
|
|
1016
|
+
const date = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
1017
|
+
const exportFile = path2.join(exportsDir, `catalog-${date}.json`);
|
|
1018
|
+
fs3.writeFileSync(exportFile, JSON.stringify(catalog, null, 2), "utf-8");
|
|
1019
|
+
logger.info(`Catalog exported to ${exportFile}`, "export");
|
|
1020
|
+
});
|
|
1005
1021
|
program.command("generate [siteDir]").description("Start the generator scripts.").action(async () => {
|
|
1006
1022
|
if (fs3.existsSync(path2.join(dir, ".env"))) {
|
|
1007
1023
|
dotenv.config({ path: path2.join(dir, ".env") });
|
package/dist/generate.cjs
CHANGED
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-GWXHXBAD.js";
|
|
4
|
+
import "./chunk-JIVNOOE7.js";
|
|
5
|
+
import "./chunk-76RGT53V.js";
|
|
6
6
|
import "./chunk-5T63CXKU.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -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
|
-
|
|
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.
|
|
10
|
+
"version": "3.26.15",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
@@ -143,6 +143,7 @@
|
|
|
143
143
|
"preview": "astro preview",
|
|
144
144
|
"astro": "astro",
|
|
145
145
|
"start:catalog": "node scripts/start-catalog-locally.js",
|
|
146
|
+
"export:catalog": "node scripts/export-catalog-locally.js",
|
|
146
147
|
"start:catalog:server": "node scripts/start-server-locally.js",
|
|
147
148
|
"preview:catalog": "node scripts/preview-catalog-locally.js",
|
|
148
149
|
"generate:catalog": "node scripts/generate-catalog-locally.js",
|