@eventcatalog/core 2.17.3 → 2.18.1
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/catalog-to-astro-content-directory.cjs +2 -1
- package/dist/catalog-to-astro-content-directory.js +2 -2
- package/dist/{chunk-5RNDOKYT.js → chunk-7JDTB3U5.js} +2 -1
- package/dist/chunk-HKXWXCBU.js +50 -0
- package/dist/{chunk-CXVZEF4D.js → chunk-S5LUNNXF.js} +1 -1
- package/dist/{chunk-NTCYOR4N.js → chunk-SHCMAL37.js} +3 -3
- package/dist/{chunk-KRBIPA23.js → chunk-T4L2ITVE.js} +1 -1
- package/dist/{chunk-55YPRY5U.js → chunk-WF34R5UT.js} +3 -3
- package/dist/{chunk-75M7LGPG.js → chunk-ZP7QFMPR.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +54 -8
- package/dist/eventcatalog.config.d.cts +13 -0
- package/dist/eventcatalog.config.d.ts +13 -0
- package/dist/eventcatalog.js +12 -7
- package/dist/map-catalog-to-astro.cjs +2 -1
- package/dist/map-catalog-to-astro.js +1 -1
- package/dist/resolve-catalog-dependencies.cjs +112 -0
- package/dist/resolve-catalog-dependencies.d.cts +3 -0
- package/dist/resolve-catalog-dependencies.d.ts +3 -0
- package/dist/resolve-catalog-dependencies.js +7 -0
- package/dist/watcher.cjs +2 -1
- package/dist/watcher.js +2 -2
- package/eventcatalog/package-lock.json +9 -0
- package/eventcatalog/package.json +1 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +32 -2
- package/package.json +2 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-S5LUNNXF.js";
|
|
4
|
+
import "../chunk-ZP7QFMPR.js";
|
|
5
|
+
import "../chunk-T4L2ITVE.js";
|
|
6
6
|
import "../chunk-E7TXTI7G.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
|
@@ -130,7 +130,8 @@ var COLLECTION_KEYS = [
|
|
|
130
130
|
"changelogs",
|
|
131
131
|
"queries",
|
|
132
132
|
"channels",
|
|
133
|
-
"ubiquitousLanguages"
|
|
133
|
+
"ubiquitousLanguages",
|
|
134
|
+
"dependencies"
|
|
134
135
|
];
|
|
135
136
|
function mapCatalogToAstro({ filePath, astroDir, projectDir }) {
|
|
136
137
|
const relativeFilePath = removeBasePath(filePath, projectDir);
|
|
@@ -12,7 +12,8 @@ var COLLECTION_KEYS = [
|
|
|
12
12
|
"changelogs",
|
|
13
13
|
"queries",
|
|
14
14
|
"channels",
|
|
15
|
-
"ubiquitousLanguages"
|
|
15
|
+
"ubiquitousLanguages",
|
|
16
|
+
"dependencies"
|
|
16
17
|
];
|
|
17
18
|
function mapCatalogToAstro({ filePath, astroDir, projectDir }) {
|
|
18
19
|
const relativeFilePath = removeBasePath(filePath, projectDir);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getEventCatalogConfigFile
|
|
3
|
+
} from "./chunk-E7TXTI7G.js";
|
|
4
|
+
|
|
5
|
+
// src/resolve-catalog-dependencies.js
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import fs from "node:fs";
|
|
8
|
+
var resolve_catalog_dependencies_default = async (catalogDir, core) => {
|
|
9
|
+
const catalogConfig = await getEventCatalogConfigFile(catalogDir);
|
|
10
|
+
const dependencies = catalogConfig?.dependencies ?? null;
|
|
11
|
+
if (!dependencies) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const dependenciesDir = path.join(catalogDir, "dependencies");
|
|
15
|
+
if (fs.existsSync(dependenciesDir)) {
|
|
16
|
+
fs.rmSync(dependenciesDir, { recursive: true, force: true });
|
|
17
|
+
}
|
|
18
|
+
fs.mkdirSync(dependenciesDir, { recursive: true });
|
|
19
|
+
const resourceTypes = Object.keys(dependencies);
|
|
20
|
+
for (const resourceType of resourceTypes) {
|
|
21
|
+
for (const dependency of dependencies[resourceType]) {
|
|
22
|
+
const resource = {
|
|
23
|
+
id: dependency.id,
|
|
24
|
+
version: dependency.version || "1.0.0"
|
|
25
|
+
};
|
|
26
|
+
const markdown = `---
|
|
27
|
+
id: ${resource.id}
|
|
28
|
+
name: ${resource.id}
|
|
29
|
+
version: ${resource.version}
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
:::warning
|
|
33
|
+
|
|
34
|
+
You are running EventCatalog with dependencies enabled.
|
|
35
|
+
|
|
36
|
+
This resource is mocked and is a dependency. This means that the resource is managed and owned by another catalog.
|
|
37
|
+
:::
|
|
38
|
+
|
|
39
|
+
`;
|
|
40
|
+
const resourceFile = path.join(dependenciesDir, resourceType, resource.id, `index.md`);
|
|
41
|
+
fs.mkdirSync(path.dirname(resourceFile), { recursive: true });
|
|
42
|
+
fs.writeFileSync(resourceFile, markdown);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
resolve_catalog_dependencies_default
|
|
50
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
mapCatalogToAstro
|
|
3
|
+
} from "./chunk-7JDTB3U5.js";
|
|
1
4
|
import {
|
|
2
5
|
addPropertyToFrontMatter,
|
|
3
6
|
verifyRequiredFieldsAreInCatalogConfigFile
|
|
4
7
|
} from "./chunk-E7TXTI7G.js";
|
|
5
|
-
import {
|
|
6
|
-
mapCatalogToAstro
|
|
7
|
-
} from "./chunk-5RNDOKYT.js";
|
|
8
8
|
|
|
9
9
|
// src/catalog-to-astro-content-directory.js
|
|
10
10
|
import { glob } from "glob";
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -29,9 +29,9 @@ var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
|
29
29
|
// src/eventcatalog.ts
|
|
30
30
|
var import_commander = require("commander");
|
|
31
31
|
var import_node_child_process = require("child_process");
|
|
32
|
-
var
|
|
32
|
+
var import_node_path5 = require("path");
|
|
33
33
|
var import_fs2 = __toESM(require("fs"), 1);
|
|
34
|
-
var
|
|
34
|
+
var import_node_path6 = __toESM(require("path"), 1);
|
|
35
35
|
var import_node_url = require("url");
|
|
36
36
|
var import_concurrently = __toESM(require("concurrently"), 1);
|
|
37
37
|
|
|
@@ -161,7 +161,7 @@ var import_axios = __toESM(require("axios"), 1);
|
|
|
161
161
|
var import_os = __toESM(require("os"), 1);
|
|
162
162
|
|
|
163
163
|
// package.json
|
|
164
|
-
var version = "2.
|
|
164
|
+
var version = "2.18.1";
|
|
165
165
|
|
|
166
166
|
// src/constants.ts
|
|
167
167
|
var VERSION = version;
|
|
@@ -227,7 +227,8 @@ var COLLECTION_KEYS = [
|
|
|
227
227
|
"changelogs",
|
|
228
228
|
"queries",
|
|
229
229
|
"channels",
|
|
230
|
-
"ubiquitousLanguages"
|
|
230
|
+
"ubiquitousLanguages",
|
|
231
|
+
"dependencies"
|
|
231
232
|
];
|
|
232
233
|
function mapCatalogToAstro({ filePath, astroDir, projectDir }) {
|
|
233
234
|
const relativeFilePath = removeBasePath(filePath, projectDir);
|
|
@@ -465,12 +466,55 @@ var catalogToAstro = async (source, astroDir) => {
|
|
|
465
466
|
await ensureAstroCollectionNotEmpty(astroDir);
|
|
466
467
|
};
|
|
467
468
|
|
|
469
|
+
// src/resolve-catalog-dependencies.js
|
|
470
|
+
var import_node_path4 = __toESM(require("path"), 1);
|
|
471
|
+
var import_node_fs3 = __toESM(require("fs"), 1);
|
|
472
|
+
var resolve_catalog_dependencies_default = async (catalogDir, core2) => {
|
|
473
|
+
const catalogConfig = await getEventCatalogConfigFile(catalogDir);
|
|
474
|
+
const dependencies = catalogConfig?.dependencies ?? null;
|
|
475
|
+
if (!dependencies) {
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
const dependenciesDir = import_node_path4.default.join(catalogDir, "dependencies");
|
|
479
|
+
if (import_node_fs3.default.existsSync(dependenciesDir)) {
|
|
480
|
+
import_node_fs3.default.rmSync(dependenciesDir, { recursive: true, force: true });
|
|
481
|
+
}
|
|
482
|
+
import_node_fs3.default.mkdirSync(dependenciesDir, { recursive: true });
|
|
483
|
+
const resourceTypes = Object.keys(dependencies);
|
|
484
|
+
for (const resourceType of resourceTypes) {
|
|
485
|
+
for (const dependency of dependencies[resourceType]) {
|
|
486
|
+
const resource = {
|
|
487
|
+
id: dependency.id,
|
|
488
|
+
version: dependency.version || "1.0.0"
|
|
489
|
+
};
|
|
490
|
+
const markdown = `---
|
|
491
|
+
id: ${resource.id}
|
|
492
|
+
name: ${resource.id}
|
|
493
|
+
version: ${resource.version}
|
|
494
|
+
---
|
|
495
|
+
|
|
496
|
+
:::warning
|
|
497
|
+
|
|
498
|
+
You are running EventCatalog with dependencies enabled.
|
|
499
|
+
|
|
500
|
+
This resource is mocked and is a dependency. This means that the resource is managed and owned by another catalog.
|
|
501
|
+
:::
|
|
502
|
+
|
|
503
|
+
`;
|
|
504
|
+
const resourceFile = import_node_path4.default.join(dependenciesDir, resourceType, resource.id, `index.md`);
|
|
505
|
+
import_node_fs3.default.mkdirSync(import_node_path4.default.dirname(resourceFile), { recursive: true });
|
|
506
|
+
import_node_fs3.default.writeFileSync(resourceFile, markdown);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
return;
|
|
510
|
+
};
|
|
511
|
+
|
|
468
512
|
// src/eventcatalog.ts
|
|
469
|
-
var currentDir =
|
|
513
|
+
var currentDir = import_node_path6.default.dirname((0, import_node_url.fileURLToPath)(importMetaUrl));
|
|
470
514
|
var program = new import_commander.Command().version(VERSION);
|
|
471
|
-
var dir =
|
|
472
|
-
var core =
|
|
473
|
-
var eventCatalogDir =
|
|
515
|
+
var dir = import_node_path6.default.resolve(process.env.PROJECT_DIR || process.cwd());
|
|
516
|
+
var core = import_node_path6.default.resolve(process.env.CATALOG_DIR || (0, import_node_path5.join)(dir, ".eventcatalog-core"));
|
|
517
|
+
var eventCatalogDir = import_node_path6.default.resolve((0, import_node_path5.join)(currentDir, "../eventcatalog/"));
|
|
474
518
|
program.name("eventcatalog").description("Documentation tool for event-driven architectures");
|
|
475
519
|
var ensureDir = (dir2) => {
|
|
476
520
|
if (!import_fs2.default.existsSync(dir2)) {
|
|
@@ -502,6 +546,7 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
502
546
|
if (options.forceRecreate) clearCore();
|
|
503
547
|
copyCore();
|
|
504
548
|
console.log("EventCatalog is starting at http://localhost:3000/docs");
|
|
549
|
+
await resolve_catalog_dependencies_default(dir, core);
|
|
505
550
|
await catalogToAstro(dir, core);
|
|
506
551
|
let watchUnsub;
|
|
507
552
|
try {
|
|
@@ -528,6 +573,7 @@ program.command("build").description("Run build of EventCatalog").action(async (
|
|
|
528
573
|
console.log("Building EventCatalog...");
|
|
529
574
|
copyCore();
|
|
530
575
|
await log_build_default(dir);
|
|
576
|
+
await resolve_catalog_dependencies_default(dir, core);
|
|
531
577
|
await catalogToAstro(dir, core);
|
|
532
578
|
(0, import_node_child_process.execSync)(`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npx astro build ${command.args.join(" ").trim()}`, {
|
|
533
579
|
cwd: core,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
type SideBarConfig = {
|
|
2
2
|
visible: boolean;
|
|
3
3
|
};
|
|
4
|
+
type ResourceDependency = {
|
|
5
|
+
id: string;
|
|
6
|
+
version?: string;
|
|
7
|
+
};
|
|
4
8
|
interface Config {
|
|
5
9
|
title: string;
|
|
6
10
|
tagline: false;
|
|
@@ -30,6 +34,15 @@ interface Config {
|
|
|
30
34
|
users?: SideBarConfig;
|
|
31
35
|
};
|
|
32
36
|
};
|
|
37
|
+
dependencies?: {
|
|
38
|
+
commands?: ResourceDependency[];
|
|
39
|
+
events?: ResourceDependency[];
|
|
40
|
+
services?: ResourceDependency[];
|
|
41
|
+
domains?: ResourceDependency[];
|
|
42
|
+
};
|
|
43
|
+
mermaid?: {
|
|
44
|
+
iconPacks?: string[];
|
|
45
|
+
};
|
|
33
46
|
}
|
|
34
47
|
|
|
35
48
|
export type { Config };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
type SideBarConfig = {
|
|
2
2
|
visible: boolean;
|
|
3
3
|
};
|
|
4
|
+
type ResourceDependency = {
|
|
5
|
+
id: string;
|
|
6
|
+
version?: string;
|
|
7
|
+
};
|
|
4
8
|
interface Config {
|
|
5
9
|
title: string;
|
|
6
10
|
tagline: false;
|
|
@@ -30,6 +34,15 @@ interface Config {
|
|
|
30
34
|
users?: SideBarConfig;
|
|
31
35
|
};
|
|
32
36
|
};
|
|
37
|
+
dependencies?: {
|
|
38
|
+
commands?: ResourceDependency[];
|
|
39
|
+
events?: ResourceDependency[];
|
|
40
|
+
services?: ResourceDependency[];
|
|
41
|
+
domains?: ResourceDependency[];
|
|
42
|
+
};
|
|
43
|
+
mermaid?: {
|
|
44
|
+
iconPacks?: string[];
|
|
45
|
+
};
|
|
33
46
|
}
|
|
34
47
|
|
|
35
48
|
export type { Config };
|
package/dist/eventcatalog.js
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
watch
|
|
3
|
+
} from "./chunk-SHCMAL37.js";
|
|
1
4
|
import {
|
|
2
5
|
log_build_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-S5LUNNXF.js";
|
|
7
|
+
import "./chunk-ZP7QFMPR.js";
|
|
5
8
|
import {
|
|
6
9
|
catalogToAstro
|
|
7
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-WF34R5UT.js";
|
|
8
11
|
import {
|
|
9
12
|
VERSION
|
|
10
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-T4L2ITVE.js";
|
|
11
14
|
import {
|
|
12
15
|
generate
|
|
13
16
|
} from "./chunk-YEQVKHST.js";
|
|
17
|
+
import "./chunk-7JDTB3U5.js";
|
|
14
18
|
import {
|
|
15
|
-
|
|
16
|
-
} from "./chunk-
|
|
19
|
+
resolve_catalog_dependencies_default
|
|
20
|
+
} from "./chunk-HKXWXCBU.js";
|
|
17
21
|
import "./chunk-E7TXTI7G.js";
|
|
18
|
-
import "./chunk-5RNDOKYT.js";
|
|
19
22
|
|
|
20
23
|
// src/eventcatalog.ts
|
|
21
24
|
import { Command } from "commander";
|
|
@@ -61,6 +64,7 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
61
64
|
if (options.forceRecreate) clearCore();
|
|
62
65
|
copyCore();
|
|
63
66
|
console.log("EventCatalog is starting at http://localhost:3000/docs");
|
|
67
|
+
await resolve_catalog_dependencies_default(dir, core);
|
|
64
68
|
await catalogToAstro(dir, core);
|
|
65
69
|
let watchUnsub;
|
|
66
70
|
try {
|
|
@@ -87,6 +91,7 @@ program.command("build").description("Run build of EventCatalog").action(async (
|
|
|
87
91
|
console.log("Building EventCatalog...");
|
|
88
92
|
copyCore();
|
|
89
93
|
await log_build_default(dir);
|
|
94
|
+
await resolve_catalog_dependencies_default(dir, core);
|
|
90
95
|
await catalogToAstro(dir, core);
|
|
91
96
|
execSync(`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npx astro build ${command.args.join(" ").trim()}`, {
|
|
92
97
|
cwd: core,
|
|
@@ -46,7 +46,8 @@ var COLLECTION_KEYS = [
|
|
|
46
46
|
"changelogs",
|
|
47
47
|
"queries",
|
|
48
48
|
"channels",
|
|
49
|
-
"ubiquitousLanguages"
|
|
49
|
+
"ubiquitousLanguages",
|
|
50
|
+
"dependencies"
|
|
50
51
|
];
|
|
51
52
|
function mapCatalogToAstro({ filePath, astroDir, projectDir }) {
|
|
52
53
|
const relativeFilePath = removeBasePath(filePath, projectDir);
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/resolve-catalog-dependencies.js
|
|
31
|
+
var resolve_catalog_dependencies_exports = {};
|
|
32
|
+
__export(resolve_catalog_dependencies_exports, {
|
|
33
|
+
default: () => resolve_catalog_dependencies_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(resolve_catalog_dependencies_exports);
|
|
36
|
+
|
|
37
|
+
// src/eventcatalog-config-file-utils.js
|
|
38
|
+
var import_promises = require("fs/promises");
|
|
39
|
+
var import_node_fs = require("fs");
|
|
40
|
+
var import_promises2 = require("fs/promises");
|
|
41
|
+
var import_node_path = __toESM(require("path"), 1);
|
|
42
|
+
var import_uuid = require("uuid");
|
|
43
|
+
var import_url = require("url");
|
|
44
|
+
var import_gray_matter = __toESM(require("gray-matter"), 1);
|
|
45
|
+
async function cleanup(projectDirectory) {
|
|
46
|
+
const filePath = import_node_path.default.join(projectDirectory, "eventcatalog.config.mjs");
|
|
47
|
+
if ((0, import_node_fs.existsSync)(filePath)) {
|
|
48
|
+
await (0, import_promises.rm)(filePath);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
52
|
+
try {
|
|
53
|
+
let configFilePath = import_node_path.default.join(projectDirectory, "eventcatalog.config.js");
|
|
54
|
+
const filePath = import_node_path.default.join(projectDirectory, "package.json");
|
|
55
|
+
const packageJson = JSON.parse(await (0, import_promises.readFile)(filePath, "utf-8"));
|
|
56
|
+
if (packageJson?.type !== "module") {
|
|
57
|
+
await (0, import_promises2.copyFile)(configFilePath, import_node_path.default.join(projectDirectory, "eventcatalog.config.mjs"));
|
|
58
|
+
configFilePath = import_node_path.default.join(projectDirectory, "eventcatalog.config.mjs");
|
|
59
|
+
}
|
|
60
|
+
const configFileURL = (0, import_url.pathToFileURL)(configFilePath).href;
|
|
61
|
+
const config = await import(
|
|
62
|
+
/* @vite-ignore */
|
|
63
|
+
configFileURL
|
|
64
|
+
);
|
|
65
|
+
return config.default;
|
|
66
|
+
} finally {
|
|
67
|
+
await cleanup(projectDirectory);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// src/resolve-catalog-dependencies.js
|
|
72
|
+
var import_node_path2 = __toESM(require("path"), 1);
|
|
73
|
+
var import_node_fs2 = __toESM(require("fs"), 1);
|
|
74
|
+
var resolve_catalog_dependencies_default = async (catalogDir, core) => {
|
|
75
|
+
const catalogConfig = await getEventCatalogConfigFile(catalogDir);
|
|
76
|
+
const dependencies = catalogConfig?.dependencies ?? null;
|
|
77
|
+
if (!dependencies) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const dependenciesDir = import_node_path2.default.join(catalogDir, "dependencies");
|
|
81
|
+
if (import_node_fs2.default.existsSync(dependenciesDir)) {
|
|
82
|
+
import_node_fs2.default.rmSync(dependenciesDir, { recursive: true, force: true });
|
|
83
|
+
}
|
|
84
|
+
import_node_fs2.default.mkdirSync(dependenciesDir, { recursive: true });
|
|
85
|
+
const resourceTypes = Object.keys(dependencies);
|
|
86
|
+
for (const resourceType of resourceTypes) {
|
|
87
|
+
for (const dependency of dependencies[resourceType]) {
|
|
88
|
+
const resource = {
|
|
89
|
+
id: dependency.id,
|
|
90
|
+
version: dependency.version || "1.0.0"
|
|
91
|
+
};
|
|
92
|
+
const markdown = `---
|
|
93
|
+
id: ${resource.id}
|
|
94
|
+
name: ${resource.id}
|
|
95
|
+
version: ${resource.version}
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
:::warning
|
|
99
|
+
|
|
100
|
+
You are running EventCatalog with dependencies enabled.
|
|
101
|
+
|
|
102
|
+
This resource is mocked and is a dependency. This means that the resource is managed and owned by another catalog.
|
|
103
|
+
:::
|
|
104
|
+
|
|
105
|
+
`;
|
|
106
|
+
const resourceFile = import_node_path2.default.join(dependenciesDir, resourceType, resource.id, `index.md`);
|
|
107
|
+
import_node_fs2.default.mkdirSync(import_node_path2.default.dirname(resourceFile), { recursive: true });
|
|
108
|
+
import_node_fs2.default.writeFileSync(resourceFile, markdown);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return;
|
|
112
|
+
};
|
package/dist/watcher.cjs
CHANGED
|
@@ -50,7 +50,8 @@ var COLLECTION_KEYS = [
|
|
|
50
50
|
"changelogs",
|
|
51
51
|
"queries",
|
|
52
52
|
"channels",
|
|
53
|
-
"ubiquitousLanguages"
|
|
53
|
+
"ubiquitousLanguages",
|
|
54
|
+
"dependencies"
|
|
54
55
|
];
|
|
55
56
|
function mapCatalogToAstro({ filePath, astroDir, projectDir }) {
|
|
56
57
|
const relativeFilePath = removeBasePath(filePath, projectDir);
|
package/dist/watcher.js
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"@asyncapi/react-component": "^2.4.3",
|
|
18
18
|
"@headlessui/react": "^2.0.3",
|
|
19
19
|
"@heroicons/react": "^2.1.3",
|
|
20
|
+
"@iconify-json/logos": "^1.2.4",
|
|
20
21
|
"@stoplight/json-schema-viewer": "^4.7.0",
|
|
21
22
|
"@stoplight/mosaic": "^1.53.2",
|
|
22
23
|
"@tailwindcss/typography": "^0.5.13",
|
|
@@ -1359,6 +1360,14 @@
|
|
|
1359
1360
|
"react": ">= 16 || ^19.0.0-rc"
|
|
1360
1361
|
}
|
|
1361
1362
|
},
|
|
1363
|
+
"node_modules/@iconify-json/logos": {
|
|
1364
|
+
"version": "1.2.4",
|
|
1365
|
+
"resolved": "https://registry.npmjs.org/@iconify-json/logos/-/logos-1.2.4.tgz",
|
|
1366
|
+
"integrity": "sha512-XC4If5D/hbaZvUkTV8iaZuGlQCyG6CNOlaAaJaGa13V5QMYwYjgtKk3vPP8wz3wtTVNVEVk3LRx1fOJz+YnSMw==",
|
|
1367
|
+
"dependencies": {
|
|
1368
|
+
"@iconify/types": "*"
|
|
1369
|
+
}
|
|
1370
|
+
},
|
|
1362
1371
|
"node_modules/@iconify/types": {
|
|
1363
1372
|
"version": "2.0.0",
|
|
1364
1373
|
"resolved": "https://registry.npmjs.org/@iconify/types/-/types-2.0.0.tgz",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"@asyncapi/react-component": "^2.4.3",
|
|
27
27
|
"@headlessui/react": "^2.0.3",
|
|
28
28
|
"@heroicons/react": "^2.1.3",
|
|
29
|
+
"@iconify-json/logos": "^1.2.4",
|
|
29
30
|
"@stoplight/json-schema-viewer": "^4.7.0",
|
|
30
31
|
"@stoplight/mosaic": "^1.53.2",
|
|
31
32
|
"@tailwindcss/typography": "^0.5.13",
|
|
@@ -21,6 +21,8 @@ import { pageDataLoader } from '@utils/page-loaders/page-data-loader';
|
|
|
21
21
|
import { ViewTransitions } from 'astro:transitions';
|
|
22
22
|
import { ArrowsRightLeftIcon } from '@heroicons/react/20/solid';
|
|
23
23
|
|
|
24
|
+
import config from '@config';
|
|
25
|
+
|
|
24
26
|
type PageTypesWithFlows = PageTypes | 'flows';
|
|
25
27
|
|
|
26
28
|
export async function getStaticPaths() {
|
|
@@ -229,21 +231,29 @@ const badges = [getBadge(), ...contentBadges, ...getSpecificationBadges()];
|
|
|
229
231
|
<style is:global>
|
|
230
232
|
.docs-layout .prose {
|
|
231
233
|
max-width: none;
|
|
232
|
-
/* max-height: 80vh; */
|
|
233
234
|
overflow: auto;
|
|
234
235
|
}
|
|
235
236
|
|
|
236
237
|
.mermaid svg {
|
|
237
238
|
margin: 1em auto 2em;
|
|
238
239
|
}
|
|
240
|
+
|
|
241
|
+
/* Fix for architecture diagrams */
|
|
242
|
+
.mermaid[data-content*='architecture'] svg {
|
|
243
|
+
max-width: 350px !important;
|
|
244
|
+
margin: 0;
|
|
245
|
+
/* width: 100px !important; */
|
|
246
|
+
}
|
|
239
247
|
</style>
|
|
240
248
|
|
|
241
|
-
<script define:vars={{ props }}>
|
|
249
|
+
<script define:vars={{ props, config }}>
|
|
242
250
|
// Fix to pass information to componets that are client side only
|
|
243
251
|
// and require catalog information
|
|
244
252
|
window.eventcatalog = {};
|
|
245
253
|
// @ts-ignore
|
|
246
254
|
window.eventcatalog[`${props.collection}-${props.data.id}`] = props.catalog;
|
|
255
|
+
|
|
256
|
+
window.eventcatalog.mermaid = config.mermaid;
|
|
247
257
|
</script>
|
|
248
258
|
|
|
249
259
|
<script>
|
|
@@ -260,6 +270,23 @@ const badges = [getBadge(), ...contentBadges, ...getSpecificationBadges()];
|
|
|
260
270
|
*/
|
|
261
271
|
async function renderDiagrams(graphs: any) {
|
|
262
272
|
const { default: mermaid } = await import('mermaid');
|
|
273
|
+
|
|
274
|
+
if (window.eventcatalog.mermaid) {
|
|
275
|
+
const { icons } = await import('@iconify-json/logos');
|
|
276
|
+
const { iconPacks = [] } = window.eventcatalog.mermaid ?? {};
|
|
277
|
+
|
|
278
|
+
if (iconPacks.length > 0) {
|
|
279
|
+
const iconPacksToRegister = iconPacks.map((name: string) => {
|
|
280
|
+
return {
|
|
281
|
+
name,
|
|
282
|
+
icons,
|
|
283
|
+
};
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
mermaid.registerIconPacks(iconPacksToRegister);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
263
290
|
mermaid.initialize({
|
|
264
291
|
// fontSize: 2,
|
|
265
292
|
flowchart: {
|
|
@@ -271,6 +298,9 @@ const badges = [getBadge(), ...contentBadges, ...getSpecificationBadges()];
|
|
|
271
298
|
fontFamily: 'var(--sans-font)',
|
|
272
299
|
// @ts-ignore This works, but TS expects a enum for some reason
|
|
273
300
|
theme: 'light',
|
|
301
|
+
architecture: {
|
|
302
|
+
useMaxWidth: true,
|
|
303
|
+
},
|
|
274
304
|
});
|
|
275
305
|
|
|
276
306
|
for (const graph of graphs) {
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "https://github.com/event-catalog/eventcatalog.git"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
|
-
"version": "2.
|
|
9
|
+
"version": "2.18.1",
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"@asyncapi/react-component": "^2.4.3",
|
|
50
50
|
"@headlessui/react": "^2.0.3",
|
|
51
51
|
"@heroicons/react": "^2.1.3",
|
|
52
|
+
"@iconify-json/logos": "^1.2.4",
|
|
52
53
|
"@parcel/watcher": "^2.4.1",
|
|
53
54
|
"@stoplight/json-schema-viewer": "^4.7.0",
|
|
54
55
|
"@stoplight/mosaic": "^1.53.2",
|