@eventcatalog/core 3.48.4 → 4.0.0-beta.0

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.
Files changed (109) hide show
  1. package/dist/analytics/analytics.cjs +1 -1
  2. package/dist/analytics/analytics.js +2 -2
  3. package/dist/analytics/log-build.cjs +1 -1
  4. package/dist/analytics/log-build.js +3 -3
  5. package/dist/catalog-to-astro-content-directory.cjs +1 -1
  6. package/dist/{chunk-SY4XL6OQ.js → chunk-7PMNFOIL.js} +1 -1
  7. package/dist/chunk-BWN544LB.js +73 -0
  8. package/dist/{chunk-JY4H7A4S.js → chunk-D3MI3OFO.js} +1 -1
  9. package/dist/{chunk-FNDSHOV2.js → chunk-HN45LKSL.js} +1 -1
  10. package/dist/{chunk-KDLSBQRP.js → chunk-JMADW4J7.js} +1 -1
  11. package/dist/{chunk-XNVSSL4W.js → chunk-NAOHQDLC.js} +1 -1
  12. package/dist/constants.cjs +1 -1
  13. package/dist/constants.js +1 -1
  14. package/dist/core-node-modules.cjs +108 -0
  15. package/dist/core-node-modules.d.cts +7 -0
  16. package/dist/core-node-modules.d.ts +7 -0
  17. package/dist/core-node-modules.js +8 -0
  18. package/dist/docs/development/components/components/15-prompt.md +5 -1
  19. package/dist/eventcatalog.cjs +124 -48
  20. package/dist/eventcatalog.js +26 -15
  21. package/dist/generate.cjs +1 -1
  22. package/dist/generate.js +3 -3
  23. package/dist/utils/cli-logger.cjs +1 -1
  24. package/dist/utils/cli-logger.js +2 -2
  25. package/eventcatalog/astro.config.mjs +27 -23
  26. package/eventcatalog/public/icons/languages/java.svg +1 -0
  27. package/eventcatalog/public/icons/payments/stripe.svg +1 -0
  28. package/eventcatalog/src/components/Badge.astro +10 -10
  29. package/eventcatalog/src/components/CopyAsMarkdown.tsx +154 -0
  30. package/eventcatalog/src/components/Grids/DomainGrid.tsx +207 -44
  31. package/eventcatalog/src/components/Grids/MessageGrid.tsx +0 -20
  32. package/eventcatalog/src/components/Grids/SystemGrid.tsx +185 -0
  33. package/eventcatalog/src/components/MDX/ADRTable/ADRTable.astro +99 -0
  34. package/eventcatalog/src/components/MDX/ADRTable/ADRTable.client.tsx +400 -0
  35. package/eventcatalog/src/components/MDX/ContextDiagram/ContextDiagramPortal.tsx +21 -0
  36. package/eventcatalog/src/components/MDX/NodeGraph/AstroNodeGraph.tsx +1 -0
  37. package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.astro +42 -6
  38. package/eventcatalog/src/components/MDX/Prompt/Prompt.astro +62 -9
  39. package/eventcatalog/src/components/MDX/ResourceRef/ResourceRef.astro +8 -1
  40. package/eventcatalog/src/components/MDX/SystemContextMap/SystemContextMapPortal.tsx +22 -0
  41. package/eventcatalog/src/components/MDX/components.tsx +7 -0
  42. package/eventcatalog/src/components/SchemaExplorer/SchemaExplorer.tsx +1 -1
  43. package/eventcatalog/src/components/SideNav/NestedSideBar/index.tsx +67 -37
  44. package/eventcatalog/src/components/Tables/Discover/DiscoverTable.tsx +47 -0
  45. package/eventcatalog/src/components/Tables/Discover/FilterComponents.tsx +10 -2
  46. package/eventcatalog/src/components/Tables/Discover/columns.tsx +115 -27
  47. package/eventcatalog/src/components/Tables/Discover/index.ts +7 -1
  48. package/eventcatalog/src/components/Tables/SystemResources/SystemResourcesTable.tsx +267 -0
  49. package/eventcatalog/src/content.config.ts +94 -8
  50. package/eventcatalog/src/enterprise/collections/resource-docs-utils.ts +4 -1
  51. package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/index.astro +12 -13
  52. package/eventcatalog/src/enterprise/custom-documentation/utils/custom-docs.ts +6 -0
  53. package/eventcatalog/src/enterprise/feature.ts +3 -1
  54. package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +85 -129
  55. package/eventcatalog/src/layouts/VisualiserLayout.astro +66 -0
  56. package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/_index.data.ts +4 -2
  57. package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/index.astro +2 -0
  58. package/eventcatalog/src/pages/diagrams/[id]/[version]/index.astro +15 -15
  59. package/eventcatalog/src/pages/discover/[type]/_index.data.ts +1 -0
  60. package/eventcatalog/src/pages/discover/[type]/index.astro +47 -2
  61. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro +15 -14
  62. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/index.astro +13 -14
  63. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/_index.data.ts +1 -0
  64. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/changelog/_index.data.ts +11 -1
  65. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +81 -26
  66. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/resources/_index.data.ts +89 -0
  67. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/resources/index.astro +85 -0
  68. package/eventcatalog/src/pages/docs/[type]/[id]/[version].md.ts +2 -0
  69. package/eventcatalog/src/pages/docs/[type]/[id]/[version].mdx.ts +2 -0
  70. package/eventcatalog/src/pages/docs/[type]/[id]/_index.data.ts +1 -0
  71. package/eventcatalog/src/pages/docs/teams/[id]/index.astro +24 -1
  72. package/eventcatalog/src/pages/docs/users/[id]/index.astro +24 -1
  73. package/eventcatalog/src/pages/index.astro +30 -7
  74. package/eventcatalog/src/pages/visualiser/[type]/[id]/[version]/_index.data.ts +1 -0
  75. package/eventcatalog/src/pages/visualiser/[type]/[id]/[version]/index.astro +1 -1
  76. package/eventcatalog/src/pages/visualiser/[type]/[id]/[version].mermaid.ts +3 -0
  77. package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/systems-context/_index.data.ts +94 -0
  78. package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/systems-context/index.astro +51 -0
  79. package/eventcatalog/src/pages/visualiser/system-context-map/index.astro +41 -0
  80. package/eventcatalog/src/pages/visualiser/systems/[id]/[version]/context/_index.data.ts +91 -0
  81. package/eventcatalog/src/pages/visualiser/systems/[id]/[version]/context/index.astro +51 -0
  82. package/eventcatalog/src/stores/sidebar-store/builders/adr.ts +3 -1
  83. package/eventcatalog/src/stores/sidebar-store/builders/agent.ts +3 -1
  84. package/eventcatalog/src/stores/sidebar-store/builders/container.ts +1 -1
  85. package/eventcatalog/src/stores/sidebar-store/builders/data-product.ts +1 -1
  86. package/eventcatalog/src/stores/sidebar-store/builders/domain.ts +127 -49
  87. package/eventcatalog/src/stores/sidebar-store/builders/message.ts +1 -1
  88. package/eventcatalog/src/stores/sidebar-store/builders/service.ts +4 -2
  89. package/eventcatalog/src/stores/sidebar-store/builders/shared.ts +2 -1
  90. package/eventcatalog/src/stores/sidebar-store/builders/system.ts +166 -0
  91. package/eventcatalog/src/stores/sidebar-store/state.ts +99 -6
  92. package/eventcatalog/src/types/index.ts +2 -0
  93. package/eventcatalog/src/utils/collection-colors.ts +6 -1
  94. package/eventcatalog/src/utils/collections/domains.ts +35 -0
  95. package/eventcatalog/src/utils/collections/icons.ts +4 -5
  96. package/eventcatalog/src/utils/collections/systems.ts +110 -0
  97. package/eventcatalog/src/utils/collections/teams.ts +15 -10
  98. package/eventcatalog/src/utils/collections/users.ts +7 -4
  99. package/eventcatalog/src/utils/collections/util.ts +2 -0
  100. package/eventcatalog/src/utils/icon-map.ts +20 -0
  101. package/eventcatalog/src/utils/icon.ts +11 -0
  102. package/eventcatalog/src/utils/node-graphs/container-node-graph.ts +12 -2
  103. package/eventcatalog/src/utils/node-graphs/domains-node-graph.ts +0 -170
  104. package/eventcatalog/src/utils/node-graphs/system-context-node-graph.ts +400 -0
  105. package/eventcatalog/src/utils/node-graphs/systems-node-graph.ts +208 -0
  106. package/eventcatalog/src/utils/node-graphs/utils/utils.ts +12 -0
  107. package/eventcatalog/src/utils/page-loaders/page-data-loader.ts +2 -0
  108. package/package.json +16 -13
  109. package/eventcatalog/src/pages/visualiser/context-map/index.astro +0 -30
@@ -22,17 +22,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
22
  mod
23
23
  ));
24
24
 
25
- // ../../node_modules/.pnpm/tsup@8.5.0_jiti@2.6.1_postcss@8.5.9_tsx@4.21.0_typescript@5.9.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js
25
+ // ../../node_modules/.pnpm/tsup@8.5.0_jiti@2.7.0_postcss@8.5.15_tsx@4.21.0_typescript@5.9.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js
26
26
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
27
27
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
28
28
 
29
29
  // src/eventcatalog.ts
30
30
  var import_commander = require("commander");
31
31
  var import_node_child_process = require("child_process");
32
- var import_node_path9 = require("path");
32
+ var import_node_path10 = require("path");
33
33
  var import_node_http = __toESM(require("http"), 1);
34
- var import_fs2 = __toESM(require("fs"), 1);
35
- var import_node_path10 = __toESM(require("path"), 1);
34
+ var import_fs3 = __toESM(require("fs"), 1);
35
+ var import_node_path11 = __toESM(require("path"), 1);
36
36
  var import_node_url = require("url");
37
37
 
38
38
  // src/generate.js
@@ -144,7 +144,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
144
144
  var import_picocolors = __toESM(require("picocolors"), 1);
145
145
 
146
146
  // package.json
147
- var version = "3.48.4";
147
+ var version = "4.0.0-beta.0";
148
148
 
149
149
  // src/constants.ts
150
150
  var VERSION = version;
@@ -1214,22 +1214,22 @@ function getAvroTypeName(type) {
1214
1214
  function walkAvroRecord(schema, prefix, fields) {
1215
1215
  if (!schema.fields || !Array.isArray(schema.fields)) return;
1216
1216
  for (const field of schema.fields) {
1217
- const path10 = prefix ? `${prefix}.${field.name}` : field.name;
1217
+ const path11 = prefix ? `${prefix}.${field.name}` : field.name;
1218
1218
  const isOptional = Array.isArray(field.type) && field.type.includes("null");
1219
1219
  const typeName = getAvroTypeName(field.type);
1220
1220
  fields.push({
1221
- path: path10,
1221
+ path: path11,
1222
1222
  type: typeName,
1223
1223
  description: field.doc || "",
1224
1224
  required: !isOptional
1225
1225
  });
1226
1226
  const innerType = Array.isArray(field.type) ? field.type.find((t) => typeof t === "object" && t.type === "record") : typeof field.type === "object" && field.type.type === "record" ? field.type : null;
1227
1227
  if (innerType) {
1228
- walkAvroRecord(innerType, path10, fields);
1228
+ walkAvroRecord(innerType, path11, fields);
1229
1229
  }
1230
1230
  const arrayType = Array.isArray(field.type) ? field.type.find((t) => typeof t === "object" && t.type === "array") : typeof field.type === "object" && field.type.type === "array" ? field.type : null;
1231
1231
  if (arrayType && typeof arrayType.items === "object" && arrayType.items.type === "record") {
1232
- walkAvroRecord(arrayType.items, `${path10}[]`, fields);
1232
+ walkAvroRecord(arrayType.items, `${path11}[]`, fields);
1233
1233
  }
1234
1234
  }
1235
1235
  }
@@ -1260,32 +1260,32 @@ function walkJsonSchema(node, prefix, requiredList, rootSchema, fields) {
1260
1260
  }
1261
1261
  if (!node.properties) return;
1262
1262
  for (const [name, prop] of Object.entries(node.properties)) {
1263
- const path10 = prefix ? `${prefix}.${name}` : name;
1263
+ const path11 = prefix ? `${prefix}.${name}` : name;
1264
1264
  const isRequired = requiredList.includes(name);
1265
1265
  if (prop.$ref) {
1266
1266
  const resolved = resolveLocalRef(prop.$ref, rootSchema);
1267
1267
  if (resolved) {
1268
1268
  const rawRefType = resolved.type || "object";
1269
1269
  const type2 = Array.isArray(rawRefType) ? [...rawRefType].sort().join(" | ") : rawRefType;
1270
- fields.push({ path: path10, type: type2, description: resolved.description || "", required: isRequired });
1270
+ fields.push({ path: path11, type: type2, description: resolved.description || "", required: isRequired });
1271
1271
  if (resolved.properties) {
1272
- walkJsonSchema(resolved, path10, resolved.required || [], rootSchema, fields);
1272
+ walkJsonSchema(resolved, path11, resolved.required || [], rootSchema, fields);
1273
1273
  }
1274
1274
  } else {
1275
- fields.push({ path: path10, type: "$ref", description: "", required: isRequired });
1275
+ fields.push({ path: path11, type: "$ref", description: "", required: isRequired });
1276
1276
  }
1277
1277
  continue;
1278
1278
  }
1279
1279
  const rawType = prop.type || (prop.enum ? "enum" : prop.$ref ? "$ref" : "object");
1280
1280
  const typeList = Array.isArray(rawType) ? rawType : [rawType];
1281
1281
  const type = Array.isArray(rawType) ? [...rawType].sort().join(" | ") : rawType;
1282
- fields.push({ path: path10, type, description: prop.description || "", required: isRequired });
1282
+ fields.push({ path: path11, type, description: prop.description || "", required: isRequired });
1283
1283
  if (typeList.includes("object") && prop.properties) {
1284
- walkJsonSchema(prop, path10, prop.required || [], rootSchema, fields);
1284
+ walkJsonSchema(prop, path11, prop.required || [], rootSchema, fields);
1285
1285
  }
1286
1286
  if (typeList.includes("array") && prop.items) {
1287
1287
  if (prop.items.type === "object" && prop.items.properties) {
1288
- walkJsonSchema(prop.items, `${path10}[]`, prop.items.required || [], rootSchema, fields);
1288
+ walkJsonSchema(prop.items, `${path11}[]`, prop.items.required || [], rootSchema, fields);
1289
1289
  }
1290
1290
  }
1291
1291
  }
@@ -1720,16 +1720,85 @@ ${errors.join("\n")}`);
1720
1720
  };
1721
1721
  };
1722
1722
 
1723
+ // src/core-node-modules.ts
1724
+ var import_fs2 = __toESM(require("fs"), 1);
1725
+ var import_node_path9 = __toESM(require("path"), 1);
1726
+ var isDirectory = (directory) => {
1727
+ try {
1728
+ return import_fs2.default.statSync(directory).isDirectory();
1729
+ } catch (error) {
1730
+ return false;
1731
+ }
1732
+ };
1733
+ var hasAstroDependency = (nodeModulesDirectory) => {
1734
+ const astroBin = process.platform === "win32" ? "astro.cmd" : "astro";
1735
+ return import_fs2.default.existsSync(import_node_path9.default.join(nodeModulesDirectory, "astro", "package.json")) || import_fs2.default.existsSync(import_node_path9.default.join(nodeModulesDirectory, ".bin", astroBin));
1736
+ };
1737
+ var isSymbolicLink = (targetPath) => {
1738
+ try {
1739
+ return import_fs2.default.lstatSync(targetPath).isSymbolicLink();
1740
+ } catch (error) {
1741
+ return false;
1742
+ }
1743
+ };
1744
+ var isSameDirectory = (a, b) => {
1745
+ try {
1746
+ return import_fs2.default.realpathSync.native(a) === import_fs2.default.realpathSync.native(b);
1747
+ } catch (error) {
1748
+ return false;
1749
+ }
1750
+ };
1751
+ var resolveInstalledCoreNodeModules = (currentDir2) => {
1752
+ const candidates = [];
1753
+ const seen = /* @__PURE__ */ new Set();
1754
+ const addCandidate = (candidate) => {
1755
+ const resolvedCandidate = import_node_path9.default.resolve(candidate);
1756
+ if (!seen.has(resolvedCandidate)) {
1757
+ candidates.push(resolvedCandidate);
1758
+ seen.add(resolvedCandidate);
1759
+ }
1760
+ };
1761
+ addCandidate(import_node_path9.default.resolve(currentDir2, "..", "node_modules"));
1762
+ let directory = import_node_path9.default.resolve(currentDir2);
1763
+ while (true) {
1764
+ if (import_node_path9.default.basename(directory) === "node_modules") {
1765
+ addCandidate(directory);
1766
+ }
1767
+ addCandidate(import_node_path9.default.join(directory, "node_modules"));
1768
+ const parentDirectory = import_node_path9.default.dirname(directory);
1769
+ if (parentDirectory === directory) {
1770
+ break;
1771
+ }
1772
+ directory = parentDirectory;
1773
+ }
1774
+ return candidates.find((candidate) => isDirectory(candidate) && hasAstroDependency(candidate)) ?? candidates.find(isDirectory);
1775
+ };
1776
+ var linkCoreNodeModules = ({
1777
+ coreNodeModules,
1778
+ installedCoreNodeModules
1779
+ }) => {
1780
+ if (!installedCoreNodeModules) return;
1781
+ if (isSymbolicLink(coreNodeModules)) {
1782
+ if (isSameDirectory(coreNodeModules, installedCoreNodeModules)) {
1783
+ return;
1784
+ }
1785
+ import_fs2.default.unlinkSync(coreNodeModules);
1786
+ } else if (import_fs2.default.existsSync(coreNodeModules)) {
1787
+ return;
1788
+ }
1789
+ import_fs2.default.symlinkSync(installedCoreNodeModules, coreNodeModules, process.platform === "win32" ? "junction" : "dir");
1790
+ };
1791
+
1723
1792
  // src/eventcatalog.ts
1724
1793
  var import_license = require("@eventcatalog/license");
1725
- var currentDir = import_node_path10.default.dirname((0, import_node_url.fileURLToPath)(importMetaUrl));
1794
+ var currentDir = import_node_path11.default.dirname((0, import_node_url.fileURLToPath)(importMetaUrl));
1726
1795
  var program = new import_commander.Command().version(VERSION);
1727
- var dir = import_node_path10.default.resolve(process.env.PROJECT_DIR || process.cwd());
1728
- var core = import_node_path10.default.resolve(process.env.CATALOG_DIR || (0, import_node_path9.join)(dir, ".eventcatalog-core"));
1729
- var eventCatalogDir = import_node_path10.default.resolve((0, import_node_path9.join)(currentDir, "../eventcatalog/"));
1796
+ var dir = import_node_path11.default.resolve(process.env.PROJECT_DIR || process.cwd());
1797
+ var core = import_node_path11.default.resolve(process.env.CATALOG_DIR || (0, import_node_path10.join)(dir, ".eventcatalog-core"));
1798
+ var eventCatalogDir = import_node_path11.default.resolve((0, import_node_path10.join)(currentDir, "../eventcatalog/"));
1730
1799
  var getInstalledEventCatalogVersion = () => {
1731
1800
  try {
1732
- const pkg = import_fs2.default.readFileSync((0, import_node_path9.join)(dir, "package.json"), "utf8");
1801
+ const pkg = import_fs3.default.readFileSync((0, import_node_path10.join)(dir, "package.json"), "utf8");
1733
1802
  const json = JSON.parse(pkg);
1734
1803
  return json.dependencies["@eventcatalog/core"];
1735
1804
  } catch (error) {
@@ -1738,8 +1807,8 @@ var getInstalledEventCatalogVersion = () => {
1738
1807
  };
1739
1808
  program.name("eventcatalog").description("Documentation tool for event-driven architectures");
1740
1809
  var ensureDir = (dir2) => {
1741
- if (!import_fs2.default.existsSync(dir2)) {
1742
- import_fs2.default.mkdirSync(dir2);
1810
+ if (!import_fs3.default.existsSync(dir2)) {
1811
+ import_fs3.default.mkdirSync(dir2);
1743
1812
  }
1744
1813
  };
1745
1814
  var resolveDevPort = async ({ projectDir }) => {
@@ -1806,12 +1875,12 @@ var createAstroDevLineFilter = () => {
1806
1875
  var buildDevSearchIndex = async ({ config }) => {
1807
1876
  const result = await buildSearchIndex({
1808
1877
  projectDir: dir,
1809
- outDir: import_node_path10.default.join(core, "public"),
1810
- searchOutputPath: import_node_path10.default.join(core, "public", "pagefind"),
1878
+ outDir: import_node_path11.default.join(core, "public"),
1879
+ searchOutputPath: import_node_path11.default.join(core, "public", "pagefind"),
1811
1880
  config,
1812
1881
  isServer: false
1813
1882
  });
1814
- logger.info(`Indexed ${result.records} page(s) into ${import_node_path10.default.relative(core, result.outputPath)}`, "search");
1883
+ logger.info(`Indexed ${result.records} page(s) into ${import_node_path11.default.relative(core, result.outputPath)}`, "search");
1815
1884
  };
1816
1885
  var warnIfIndexedSearchUsesAuth = async () => {
1817
1886
  if (!await isAuthEnabled()) {
@@ -1923,15 +1992,20 @@ var copyCore = () => {
1923
1992
  if (eventCatalogDir === core) {
1924
1993
  return;
1925
1994
  }
1926
- import_fs2.default.cpSync(eventCatalogDir, core, {
1995
+ import_fs3.default.cpSync(eventCatalogDir, core, {
1927
1996
  recursive: true,
1928
1997
  filter: (src) => {
1929
- return true;
1998
+ const relativePath = import_node_path11.default.relative(eventCatalogDir, src);
1999
+ const pathParts = relativePath.split(import_node_path11.default.sep);
2000
+ return !pathParts.some((part) => [".astro", "dist", "node_modules"].includes(part));
1930
2001
  }
1931
2002
  });
2003
+ const coreNodeModules = import_node_path11.default.join(core, "node_modules");
2004
+ const installedCoreNodeModules = resolveInstalledCoreNodeModules(currentDir);
2005
+ linkCoreNodeModules({ coreNodeModules, installedCoreNodeModules });
1932
2006
  };
1933
2007
  var clearCore = () => {
1934
- if (import_fs2.default.existsSync(core)) import_fs2.default.rmSync(core, { recursive: true });
2008
+ if (import_fs3.default.existsSync(core)) import_fs3.default.rmSync(core, { recursive: true });
1935
2009
  };
1936
2010
  var checkForUpdate = () => {
1937
2011
  const installedVersion = getInstalledEventCatalogVersion();
@@ -1985,8 +2059,8 @@ program.command("dev").description("Run development server of EventCatalog").opt
1985
2059
  logger.info("Setting up EventCatalog...", "eventcatalog");
1986
2060
  const isServer = await isOutputServer();
1987
2061
  logger.info(isServer ? "EventCatalog is running in Server Mode" : "EventCatalog is running in Static Mode", "config");
1988
- if (import_fs2.default.existsSync(import_node_path10.default.join(dir, ".env"))) {
1989
- import_dotenv.default.config({ path: import_node_path10.default.join(dir, ".env") });
2062
+ if (import_fs3.default.existsSync(import_node_path11.default.join(dir, ".env"))) {
2063
+ import_dotenv.default.config({ path: import_node_path11.default.join(dir, ".env") });
1990
2064
  }
1991
2065
  if (options.debug) {
1992
2066
  logger.info("Debug mode enabled", "debug");
@@ -2049,6 +2123,7 @@ program.command("dev").description("Run development server of EventCatalog").opt
2049
2123
  EVENTCATALOG_STARTER: String(isEventCatalogStarter),
2050
2124
  EVENTCATALOG_SCALE: String(isEventCatalogScale),
2051
2125
  EVENTCATALOG_DEV_MODE: "true",
2126
+ IGNORE_BUILD_ARTIFACTS: "true",
2052
2127
  NODE_NO_WARNINGS: "1"
2053
2128
  },
2054
2129
  shouldFilterLine: createAstroDevLineFilter(),
@@ -2065,8 +2140,8 @@ program.command("build").description("Run build of EventCatalog").action(async (
2065
2140
  logger.info("Building EventCatalog...", "build");
2066
2141
  const isServer = await isOutputServer();
2067
2142
  logger.info(isServer ? "EventCatalog is running in Server Mode" : "EventCatalog is running in Static Mode", "config");
2068
- if (import_fs2.default.existsSync(import_node_path10.default.join(dir, ".env"))) {
2069
- import_dotenv.default.config({ path: import_node_path10.default.join(dir, ".env") });
2143
+ if (import_fs3.default.existsSync(import_node_path11.default.join(dir, ".env"))) {
2144
+ import_dotenv.default.config({ path: import_node_path11.default.join(dir, ".env") });
2070
2145
  }
2071
2146
  await verifyRequiredFieldsAreInCatalogConfigFile(dir);
2072
2147
  copyCore();
@@ -2108,14 +2183,15 @@ program.command("build").description("Run build of EventCatalog").action(async (
2108
2183
  CATALOG_DIR: core,
2109
2184
  ENABLE_EMBED: String(canEmbedPages),
2110
2185
  EVENTCATALOG_STARTER: String(isEventCatalogStarter),
2111
- EVENTCATALOG_SCALE: String(isEventCatalogScale)
2186
+ EVENTCATALOG_SCALE: String(isEventCatalogScale),
2187
+ IGNORE_BUILD_ARTIFACTS: "true"
2112
2188
  },
2113
2189
  shouldFilterLine: createAstroLineFilter()
2114
2190
  });
2115
2191
  if (await isIndexedSearchEnabled()) {
2116
2192
  await warnIfIndexedSearchUsesAuth();
2117
2193
  const config = await getEventCatalogConfigFile(dir);
2118
- const outDir = import_node_path10.default.resolve(dir, await getProjectOutDir());
2194
+ const outDir = import_node_path11.default.resolve(dir, await getProjectOutDir());
2119
2195
  logger.info("Building indexed search...", "search");
2120
2196
  const result = await buildSearchIndex({
2121
2197
  projectDir: dir,
@@ -2123,7 +2199,7 @@ program.command("build").description("Run build of EventCatalog").action(async (
2123
2199
  config,
2124
2200
  isServer
2125
2201
  });
2126
- logger.info(`Indexed ${result.records} page(s) into ${import_node_path10.default.relative(dir, result.outputPath)}`, "search");
2202
+ logger.info(`Indexed ${result.records} page(s) into ${import_node_path11.default.relative(dir, result.outputPath)}`, "search");
2127
2203
  }
2128
2204
  });
2129
2205
  var previewCatalog = ({
@@ -2146,7 +2222,7 @@ var startServerCatalog = ({
2146
2222
  isEventCatalogStarter = false,
2147
2223
  isEventCatalogScale = false
2148
2224
  }) => {
2149
- const serverEntryPath = import_node_path10.default.join(dir, "dist", "server", "entry.mjs");
2225
+ const serverEntryPath = import_node_path11.default.join(dir, "dist", "server", "entry.mjs");
2150
2226
  (0, import_node_child_process.execSync)(
2151
2227
  `cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_STARTER=${isEventCatalogStarter} EVENTCATALOG_SCALE=${isEventCatalogScale} node "${serverEntryPath}"`,
2152
2228
  {
@@ -2158,8 +2234,8 @@ var startServerCatalog = ({
2158
2234
  program.command("preview").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
2159
2235
  logger.welcome();
2160
2236
  logger.info("Starting preview of your build...", "preview");
2161
- if (import_fs2.default.existsSync(import_node_path10.default.join(dir, ".env"))) {
2162
- import_dotenv.default.config({ path: import_node_path10.default.join(dir, ".env") });
2237
+ if (import_fs3.default.existsSync(import_node_path11.default.join(dir, ".env"))) {
2238
+ import_dotenv.default.config({ path: import_node_path11.default.join(dir, ".env") });
2163
2239
  }
2164
2240
  const canEmbedPages = await (0, import_license.isFeatureEnabled)(
2165
2241
  "@eventcatalog/backstage-plugin-eventcatalog",
@@ -2172,8 +2248,8 @@ program.command("preview").description("Serves the contents of your eventcatalog
2172
2248
  program.command("start").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
2173
2249
  logger.welcome();
2174
2250
  logger.info("Starting preview of your build...", "preview");
2175
- if (import_fs2.default.existsSync(import_node_path10.default.join(dir, ".env"))) {
2176
- import_dotenv.default.config({ path: import_node_path10.default.join(dir, ".env") });
2251
+ if (import_fs3.default.existsSync(import_node_path11.default.join(dir, ".env"))) {
2252
+ import_dotenv.default.config({ path: import_node_path11.default.join(dir, ".env") });
2177
2253
  }
2178
2254
  const canEmbedPages = await (0, import_license.isFeatureEnabled)(
2179
2255
  "@eventcatalog/backstage-plugin-eventcatalog",
@@ -2201,22 +2277,22 @@ program.command("start").description("Serves the contents of your eventcatalog b
2201
2277
  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) => {
2202
2278
  logger.welcome();
2203
2279
  logger.info("Exporting EventCatalog...", "export");
2204
- if (import_fs2.default.existsSync(import_node_path10.default.join(dir, ".env"))) {
2205
- import_dotenv.default.config({ path: import_node_path10.default.join(dir, ".env") });
2280
+ if (import_fs3.default.existsSync(import_node_path11.default.join(dir, ".env"))) {
2281
+ import_dotenv.default.config({ path: import_node_path11.default.join(dir, ".env") });
2206
2282
  }
2207
2283
  const { default: initSDK } = await import("@eventcatalog/sdk");
2208
2284
  const sdk = initSDK(dir);
2209
2285
  const catalog = await sdk.dumpCatalog({ includeMarkdown: options.includeMarkdown });
2210
- const exportsDir = import_node_path10.default.join(dir, "exports");
2286
+ const exportsDir = import_node_path11.default.join(dir, "exports");
2211
2287
  ensureDir(exportsDir);
2212
2288
  const date = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
2213
- const exportFile = import_node_path10.default.join(exportsDir, `catalog-${date}.json`);
2214
- import_fs2.default.writeFileSync(exportFile, JSON.stringify(catalog, null, 2), "utf-8");
2289
+ const exportFile = import_node_path11.default.join(exportsDir, `catalog-${date}.json`);
2290
+ import_fs3.default.writeFileSync(exportFile, JSON.stringify(catalog, null, 2), "utf-8");
2215
2291
  logger.info(`Catalog exported to ${exportFile}`, "export");
2216
2292
  });
2217
2293
  program.command("generate [siteDir]").description("Start the generator scripts.").action(async () => {
2218
- if (import_fs2.default.existsSync(import_node_path10.default.join(dir, ".env"))) {
2219
- import_dotenv.default.config({ path: import_node_path10.default.join(dir, ".env") });
2294
+ if (import_fs3.default.existsSync(import_node_path11.default.join(dir, ".env"))) {
2295
+ import_dotenv.default.config({ path: import_node_path11.default.join(dir, ".env") });
2220
2296
  }
2221
2297
  await generate(dir);
2222
2298
  });
@@ -1,7 +1,16 @@
1
+ import {
2
+ log_build_default
3
+ } from "./chunk-7PMNFOIL.js";
1
4
  import {
2
5
  runMigrations
3
6
  } from "./chunk-XUAF2H54.js";
4
7
  import "./chunk-CA4U2JP7.js";
8
+ import {
9
+ generate
10
+ } from "./chunk-NAOHQDLC.js";
11
+ import {
12
+ logger
13
+ } from "./chunk-JMADW4J7.js";
5
14
  import {
6
15
  resolve_catalog_dependencies_default
7
16
  } from "./chunk-LHR4G2UO.js";
@@ -11,30 +20,25 @@ import {
11
20
  import {
12
21
  watch
13
22
  } from "./chunk-O3Y2G6CY.js";
14
- import {
15
- log_build_default
16
- } from "./chunk-SY4XL6OQ.js";
17
- import "./chunk-FNDSHOV2.js";
23
+ import "./chunk-HN45LKSL.js";
18
24
  import "./chunk-DAOXTQVS.js";
19
25
  import {
20
26
  catalogToAstro
21
27
  } from "./chunk-WQNKHIDM.js";
22
28
  import "./chunk-VC6VUJIX.js";
29
+ import {
30
+ VERSION
31
+ } from "./chunk-D3MI3OFO.js";
32
+ import {
33
+ linkCoreNodeModules,
34
+ resolveInstalledCoreNodeModules
35
+ } from "./chunk-BWN544LB.js";
23
36
  import {
24
37
  getProjectOutDir,
25
38
  isAuthEnabled,
26
39
  isIndexedSearchEnabled,
27
40
  isOutputServer
28
41
  } from "./chunk-B7HCX5HM.js";
29
- import {
30
- generate
31
- } from "./chunk-XNVSSL4W.js";
32
- import {
33
- logger
34
- } from "./chunk-KDLSBQRP.js";
35
- import {
36
- VERSION
37
- } from "./chunk-JY4H7A4S.js";
38
42
  import {
39
43
  getEventCatalogConfigFile,
40
44
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -807,9 +811,14 @@ var copyCore = () => {
807
811
  fs3.cpSync(eventCatalogDir, core, {
808
812
  recursive: true,
809
813
  filter: (src) => {
810
- return true;
814
+ const relativePath = path2.relative(eventCatalogDir, src);
815
+ const pathParts = relativePath.split(path2.sep);
816
+ return !pathParts.some((part) => [".astro", "dist", "node_modules"].includes(part));
811
817
  }
812
818
  });
819
+ const coreNodeModules = path2.join(core, "node_modules");
820
+ const installedCoreNodeModules = resolveInstalledCoreNodeModules(currentDir);
821
+ linkCoreNodeModules({ coreNodeModules, installedCoreNodeModules });
813
822
  };
814
823
  var clearCore = () => {
815
824
  if (fs3.existsSync(core)) fs3.rmSync(core, { recursive: true });
@@ -930,6 +939,7 @@ program.command("dev").description("Run development server of EventCatalog").opt
930
939
  EVENTCATALOG_STARTER: String(isEventCatalogStarter),
931
940
  EVENTCATALOG_SCALE: String(isEventCatalogScale),
932
941
  EVENTCATALOG_DEV_MODE: "true",
942
+ IGNORE_BUILD_ARTIFACTS: "true",
933
943
  NODE_NO_WARNINGS: "1"
934
944
  },
935
945
  shouldFilterLine: createAstroDevLineFilter(),
@@ -989,7 +999,8 @@ program.command("build").description("Run build of EventCatalog").action(async (
989
999
  CATALOG_DIR: core,
990
1000
  ENABLE_EMBED: String(canEmbedPages),
991
1001
  EVENTCATALOG_STARTER: String(isEventCatalogStarter),
992
- EVENTCATALOG_SCALE: String(isEventCatalogScale)
1002
+ EVENTCATALOG_SCALE: String(isEventCatalogScale),
1003
+ IGNORE_BUILD_ARTIFACTS: "true"
993
1004
  },
994
1005
  shouldFilterLine: createAstroLineFilter()
995
1006
  });
package/dist/generate.cjs CHANGED
@@ -108,7 +108,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
108
108
  var import_picocolors = __toESM(require("picocolors"), 1);
109
109
 
110
110
  // package.json
111
- var version = "3.48.4";
111
+ var version = "4.0.0-beta.0";
112
112
 
113
113
  // src/constants.ts
114
114
  var VERSION = version;
package/dist/generate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-XNVSSL4W.js";
4
- import "./chunk-KDLSBQRP.js";
5
- import "./chunk-JY4H7A4S.js";
3
+ } from "./chunk-NAOHQDLC.js";
4
+ import "./chunk-JMADW4J7.js";
5
+ import "./chunk-D3MI3OFO.js";
6
6
  import "./chunk-6QENHZZP.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.48.4";
39
+ var version = "4.0.0-beta.0";
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-KDLSBQRP.js";
4
- import "../chunk-JY4H7A4S.js";
3
+ } from "../chunk-JMADW4J7.js";
4
+ import "../chunk-D3MI3OFO.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -1,4 +1,5 @@
1
1
  import { defineConfig } from 'astro/config';
2
+ import { unified } from '@astrojs/markdown-remark';
2
3
  import tailwindcss from '@tailwindcss/vite';
3
4
  import mdx from '@astrojs/mdx';
4
5
  import react from '@astrojs/react';
@@ -38,6 +39,22 @@ const searchType = config.search?.type || 'resource';
38
39
 
39
40
  const markdownRemarkPlugins = [remarkDirective, remarkDirectives, remarkComment, mermaid, plantuml];
40
41
  const mdxRemarkPlugins = [...markdownRemarkPlugins, remarkResourceRef];
42
+ const mdxRehypePlugins = [
43
+ [
44
+ rehypeExpressiveCode,
45
+ {
46
+ ...expressiveCodeConfig,
47
+ },
48
+ ],
49
+ rehypeSlug,
50
+ [
51
+ rehypeAutolinkHeadings,
52
+ {
53
+ behavior: 'append',
54
+ properties: { className: ['anchor-link'] },
55
+ },
56
+ ],
57
+ ];
41
58
 
42
59
  // https://astro.build/config
43
60
  export default defineConfig({
@@ -69,8 +86,10 @@ export default defineConfig({
69
86
  trailingSlash: config.trailingSlash === true ? 'always' : 'ignore',
70
87
 
71
88
  markdown: {
72
- remarkPlugins: markdownRemarkPlugins,
73
- gfm: true,
89
+ processor: unified({
90
+ remarkPlugins: markdownRemarkPlugins,
91
+ rehypePlugins: mdxRehypePlugins,
92
+ }),
74
93
  },
75
94
 
76
95
  // just turn this off for all users (for now...)
@@ -82,24 +101,10 @@ export default defineConfig({
82
101
  mdx({
83
102
  // https://docs.astro.build/en/guides/integrations-guide/mdx/#optimize
84
103
  optimize: config.mdxOptimize || false,
85
- remarkPlugins: mdxRemarkPlugins,
86
- rehypePlugins: [
87
- [
88
- rehypeExpressiveCode,
89
- {
90
- ...expressiveCodeConfig,
91
- },
92
- ],
93
- rehypeSlug,
94
- [
95
- rehypeAutolinkHeadings,
96
- {
97
- behavior: 'append',
98
- properties: { className: ['anchor-link'] },
99
- },
100
- ],
101
- ],
102
- gfm: true,
104
+ processor: unified({
105
+ remarkPlugins: mdxRemarkPlugins,
106
+ rehypePlugins: mdxRehypePlugins,
107
+ }),
103
108
  }),
104
109
  effectiveOutput !== 'server' &&
105
110
  compress &&
@@ -182,10 +187,9 @@ export default defineConfig({
182
187
  'react',
183
188
  'react-dom',
184
189
  'semver',
190
+ 'diff',
191
+ 'diff2html',
185
192
  ],
186
- esbuildOptions: {
187
- jsx: 'automatic',
188
- },
189
193
  },
190
194
  },
191
195
  });
@@ -0,0 +1 @@
1
+ <svg fill="#ED8B00" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Java</title><path d="M8.851 18.56s-.917.534.653.714c1.902.218 2.874.187 4.969-.211 0 0 .552.346 1.321.646-4.699 2.013-10.633-.118-6.943-1.149M8.276 15.933s-1.028.761.542.924c2.032.209 3.636.227 6.413-.308 0 0 .384.389.987.602-5.679 1.661-12.007.13-7.942-1.218M13.116 11.475c1.158 1.333-.304 2.533-.304 2.533s2.939-1.518 1.589-3.418c-1.261-1.772-2.228-2.652 3.007-5.688 0-.001-8.216 2.051-4.292 6.573M19.33 20.504s.679.559-.747.991c-2.712.822-11.288 1.069-13.669.033-.856-.373.75-.89 1.254-.998.527-.114.828-.093.828-.093-.953-.671-6.156 1.317-2.643 1.887 9.58 1.553 17.462-.7 14.977-1.82M9.292 13.21s-4.362 1.036-1.544 1.412c1.189.159 3.561.123 5.77-.062 1.806-.152 3.618-.477 3.618-.477s-.637.272-1.098.587c-4.429 1.165-12.986.623-10.522-.568 2.082-1.006 3.776-.892 3.776-.892M17.116 17.584c4.503-2.34 2.421-4.589.968-4.285-.355.074-.515.138-.515.138s.132-.207.385-.297c2.875-1.011 5.086 2.981-.928 4.562 0-.001.07-.062.09-.118M13.408 0s2.494 2.494-2.365 6.33c-3.896 3.077-.888 4.832-.001 6.836-2.274-2.053-3.943-3.858-2.824-5.539 1.644-2.469 6.197-3.665 5.19-7.627M9.734 23.924c4.322.277 10.959-.153 11.116-2.198 0 0-.302.775-3.572 1.391-3.688.694-8.239.613-10.937.168 0-.001.553.457 3.393.639"/></svg>
@@ -0,0 +1 @@
1
+ <svg fill="#635BFF" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Stripe</title><path d="M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.090 1.631l.890-5.494C18.252.975 15.687 0 12.585 0 10.469 0 8.703.555 7.439 1.583 6.123 2.658 5.444 4.208 5.444 6.078c0 3.39 2.072 4.839 5.446 6.057 2.172.78 2.901 1.331 2.901 2.179 0 .825-.707 1.306-1.978 1.306-1.575 0-4.18-.78-5.886-1.768L5.04 19.601c1.46.831 4.157 1.673 6.952 1.673 2.235 0 4.098-.527 5.355-1.523 1.406-1.085 2.135-2.682 2.135-4.764 0-3.471-2.118-4.926-5.507-6.117v.28z"/></svg>
@@ -26,7 +26,7 @@ const href = getBadgeHref(badge);
26
26
  const Icon = badge.icon || badge.iconComponent;
27
27
  const hasThemedIcon = badge.iconURLLight && badge.iconURLDark;
28
28
  const classes = `
29
- inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium
29
+ inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md text-xs font-medium
30
30
  ${badge.backgroundColor ? 'bg-[rgb(var(--ec-content-hover))]' : 'bg-transparent'} border border-[rgb(var(--ec-page-border))]
31
31
  text-[rgb(var(--ec-page-text))]
32
32
  shadow-xs
@@ -38,11 +38,11 @@ const classes = `
38
38
  {
39
39
  href ? (
40
40
  <a id={badge.id || undefined} href={href} class={classes} style={getBadgeStyle(badge)} title={badge.content}>
41
- {Icon && <Icon className="w-4 h-4 flex-shrink-0" />}
41
+ {Icon && <Icon className="w-3 h-3 flex-shrink-0" />}
42
42
  {hasThemedIcon && (
43
43
  <img
44
44
  src={badge.iconURLLight}
45
- class="w-4 h-4 flex-shrink-0 opacity-80 dark:hidden"
45
+ class="w-3 h-3 flex-shrink-0 opacity-80 dark:hidden"
46
46
  alt=""
47
47
  onerror="this.style.display='none'"
48
48
  />
@@ -50,24 +50,24 @@ const classes = `
50
50
  {hasThemedIcon && (
51
51
  <img
52
52
  src={badge.iconURLDark}
53
- class="hidden w-4 h-4 flex-shrink-0 opacity-80 dark:inline-block"
53
+ class="hidden w-3 h-3 flex-shrink-0 opacity-80 dark:inline-block"
54
54
  alt=""
55
55
  onerror="this.style.display='none'"
56
56
  />
57
57
  )}
58
58
  {!hasThemedIcon && badge.iconURL && (
59
- <img src={badge.iconURL} class="w-4 h-4 flex-shrink-0 opacity-80" alt="" onerror="this.style.display='none'" />
59
+ <img src={badge.iconURL} class="w-3 h-3 flex-shrink-0 opacity-80" alt="" onerror="this.style.display='none'" />
60
60
  )}
61
61
  <span>{badge.content}</span>
62
- <ArrowTopRightOnSquareIcon className="w-3.5 h-3.5 flex-shrink-0 opacity-70" aria-hidden="true" />
62
+ <ArrowTopRightOnSquareIcon className="w-2.5 h-2.5 flex-shrink-0 opacity-70" aria-hidden="true" />
63
63
  </a>
64
64
  ) : (
65
65
  <span id={badge.id || undefined} class={classes} style={getBadgeStyle(badge)} title={badge.content}>
66
- {Icon && <Icon className="w-4 h-4 flex-shrink-0" />}
66
+ {Icon && <Icon className="w-3 h-3 flex-shrink-0" />}
67
67
  {hasThemedIcon && (
68
68
  <img
69
69
  src={badge.iconURLLight}
70
- class="w-4 h-4 flex-shrink-0 opacity-80 dark:hidden"
70
+ class="w-3 h-3 flex-shrink-0 opacity-80 dark:hidden"
71
71
  alt=""
72
72
  onerror="this.style.display='none'"
73
73
  />
@@ -75,13 +75,13 @@ const classes = `
75
75
  {hasThemedIcon && (
76
76
  <img
77
77
  src={badge.iconURLDark}
78
- class="hidden w-4 h-4 flex-shrink-0 opacity-80 dark:inline-block"
78
+ class="hidden w-3 h-3 flex-shrink-0 opacity-80 dark:inline-block"
79
79
  alt=""
80
80
  onerror="this.style.display='none'"
81
81
  />
82
82
  )}
83
83
  {!hasThemedIcon && badge.iconURL && (
84
- <img src={badge.iconURL} class="w-4 h-4 flex-shrink-0 opacity-80" alt="" onerror="this.style.display='none'" />
84
+ <img src={badge.iconURL} class="w-3 h-3 flex-shrink-0 opacity-80" alt="" onerror="this.style.display='none'" />
85
85
  )}
86
86
  <span>{badge.content}</span>
87
87
  </span>