@eventcatalog/core 2.53.1 → 2.54.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.
@@ -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 = "2.53.1";
40
+ var version = "2.54.1";
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-Q363JHA2.js";
4
- import "../chunk-K5LYWIYR.js";
3
+ } from "../chunk-7NKHMS4K.js";
4
+ import "../chunk-EUDMSTHT.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -106,7 +106,7 @@ var import_axios = __toESM(require("axios"), 1);
106
106
  var import_os = __toESM(require("os"), 1);
107
107
 
108
108
  // package.json
109
- var version = "2.53.1";
109
+ var version = "2.54.1";
110
110
 
111
111
  // src/constants.ts
112
112
  var VERSION = version;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-BQDTPLND.js";
4
- import "../chunk-Q363JHA2.js";
5
- import "../chunk-K5LYWIYR.js";
3
+ } from "../chunk-ONQOSPKG.js";
4
+ import "../chunk-7NKHMS4K.js";
5
+ import "../chunk-EUDMSTHT.js";
6
6
  import "../chunk-E7TXTI7G.js";
7
7
  export {
8
8
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-K5LYWIYR.js";
3
+ } from "./chunk-EUDMSTHT.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.53.1";
2
+ var version = "2.54.1";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -6,6 +6,10 @@ import {
6
6
  import boxen from "boxen";
7
7
  import { join } from "node:path";
8
8
  import fs from "node:fs";
9
+ var getProjectOutDir = async () => {
10
+ const config = await getEventCatalogConfigFile(process.env.PROJECT_DIR || "");
11
+ return config?.outDir || "dist";
12
+ };
9
13
  var isOutputServer = async () => {
10
14
  const config = await getEventCatalogConfigFile(process.env.PROJECT_DIR || "");
11
15
  return config?.output === "server";
@@ -144,6 +148,7 @@ var isEventCatalogStarterEnabled = async (licenseKey) => {
144
148
  };
145
149
 
146
150
  export {
151
+ getProjectOutDir,
147
152
  isOutputServer,
148
153
  isAuthEnabled,
149
154
  isBackstagePluginEnabled,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-Q363JHA2.js";
3
+ } from "./chunk-7NKHMS4K.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "2.53.1";
28
+ var version = "2.54.1";
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-K5LYWIYR.js";
3
+ } from "./chunk-EUDMSTHT.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -157,7 +157,7 @@ var import_axios = __toESM(require("axios"), 1);
157
157
  var import_os = __toESM(require("os"), 1);
158
158
 
159
159
  // package.json
160
- var version = "2.53.1";
160
+ var version = "2.54.1";
161
161
 
162
162
  // src/constants.ts
163
163
  var VERSION = version;
@@ -506,6 +506,10 @@ var import_boxen2 = __toESM(require("boxen"), 1);
506
506
  var import_boxen = __toESM(require("boxen"), 1);
507
507
  var import_node_path5 = require("path");
508
508
  var import_node_fs4 = __toESM(require("fs"), 1);
509
+ var getProjectOutDir = async () => {
510
+ const config = await getEventCatalogConfigFile(process.env.PROJECT_DIR || "");
511
+ return config?.outDir || "dist";
512
+ };
509
513
  var isOutputServer = async () => {
510
514
  const config = await getEventCatalogConfigFile(process.env.PROJECT_DIR || "");
511
515
  return config?.output === "server";
@@ -799,6 +803,7 @@ program.command("build").description("Run build of EventCatalog").action(async (
799
803
  const canEmbedPages = await isBackstagePluginEnabled();
800
804
  const isEventCatalogStarter = await isEventCatalogStarterEnabled();
801
805
  const isEventCatalogScale = await isEventCatalogScaleEnabled();
806
+ const isServerOutput = await isOutputServer();
802
807
  await createAuthFileIfNotExists(isEventCatalogScale);
803
808
  await log_build_default(dir, {
804
809
  isEventCatalogStarterEnabled: isEventCatalogStarter,
@@ -819,6 +824,22 @@ program.command("build").description("Run build of EventCatalog").action(async (
819
824
  stdio: "inherit"
820
825
  }
821
826
  );
827
+ if (!isServerOutput) {
828
+ const outDir = await getProjectOutDir();
829
+ const windowsCommand2 = `npx -y pagefind --site ${outDir}`;
830
+ const unixCommand2 = `npx -y pagefind --site ${outDir}`;
831
+ const pagefindCommand = process.platform === "win32" ? windowsCommand2 : unixCommand2;
832
+ (0, import_node_child_process.execSync)(
833
+ `cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_STARTER=${isEventCatalogStarter} EVENTCATALOG_SCALE=${isEventCatalogScale} ${pagefindCommand}`,
834
+ {
835
+ cwd: dir,
836
+ stdio: "inherit"
837
+ }
838
+ );
839
+ if (import_fs2.default.existsSync((0, import_node_path6.join)(dir, outDir, "pagefind"))) {
840
+ import_fs2.default.cpSync((0, import_node_path6.join)(dir, outDir, "pagefind"), (0, import_node_path6.join)(dir, "public", "pagefind"), { recursive: true });
841
+ }
842
+ }
822
843
  });
823
844
  var previewCatalog = ({
824
845
  command,
@@ -6,8 +6,8 @@ import {
6
6
  } from "./chunk-XE6PFSH5.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-BQDTPLND.js";
10
- import "./chunk-Q363JHA2.js";
9
+ } from "./chunk-ONQOSPKG.js";
10
+ import "./chunk-7NKHMS4K.js";
11
11
  import {
12
12
  catalogToAstro,
13
13
  checkAndConvertMdToMdx
@@ -15,14 +15,15 @@ import {
15
15
  import "./chunk-LDBRNJIL.js";
16
16
  import {
17
17
  VERSION
18
- } from "./chunk-K5LYWIYR.js";
18
+ } from "./chunk-EUDMSTHT.js";
19
19
  import {
20
+ getProjectOutDir,
20
21
  isAuthEnabled,
21
22
  isBackstagePluginEnabled,
22
23
  isEventCatalogScaleEnabled,
23
24
  isEventCatalogStarterEnabled,
24
25
  isOutputServer
25
- } from "./chunk-LUUBKWYP.js";
26
+ } from "./chunk-MCSZBCOG.js";
26
27
  import {
27
28
  generate
28
29
  } from "./chunk-YEQVKHST.js";
@@ -192,6 +193,7 @@ program.command("build").description("Run build of EventCatalog").action(async (
192
193
  const canEmbedPages = await isBackstagePluginEnabled();
193
194
  const isEventCatalogStarter = await isEventCatalogStarterEnabled();
194
195
  const isEventCatalogScale = await isEventCatalogScaleEnabled();
196
+ const isServerOutput = await isOutputServer();
195
197
  await createAuthFileIfNotExists(isEventCatalogScale);
196
198
  await log_build_default(dir, {
197
199
  isEventCatalogStarterEnabled: isEventCatalogStarter,
@@ -212,6 +214,22 @@ program.command("build").description("Run build of EventCatalog").action(async (
212
214
  stdio: "inherit"
213
215
  }
214
216
  );
217
+ if (!isServerOutput) {
218
+ const outDir = await getProjectOutDir();
219
+ const windowsCommand2 = `npx -y pagefind --site ${outDir}`;
220
+ const unixCommand2 = `npx -y pagefind --site ${outDir}`;
221
+ const pagefindCommand = process.platform === "win32" ? windowsCommand2 : unixCommand2;
222
+ execSync(
223
+ `cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_STARTER=${isEventCatalogStarter} EVENTCATALOG_SCALE=${isEventCatalogScale} ${pagefindCommand}`,
224
+ {
225
+ cwd: dir,
226
+ stdio: "inherit"
227
+ }
228
+ );
229
+ if (fs.existsSync(join(dir, outDir, "pagefind"))) {
230
+ fs.cpSync(join(dir, outDir, "pagefind"), join(dir, "public", "pagefind"), { recursive: true });
231
+ }
232
+ }
215
233
  });
216
234
  var previewCatalog = ({
217
235
  command,
package/dist/features.cjs CHANGED
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/features.ts
31
31
  var features_exports = {};
32
32
  __export(features_exports, {
33
+ getProjectOutDir: () => getProjectOutDir,
33
34
  isAuthEnabled: () => isAuthEnabled,
34
35
  isBackstagePluginEnabled: () => isBackstagePluginEnabled,
35
36
  isEventCatalogScaleEnabled: () => isEventCatalogScaleEnabled,
@@ -76,6 +77,10 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
76
77
  // src/features.ts
77
78
  var import_node_path2 = require("path");
78
79
  var import_node_fs2 = __toESM(require("fs"), 1);
80
+ var getProjectOutDir = async () => {
81
+ const config = await getEventCatalogConfigFile(process.env.PROJECT_DIR || "");
82
+ return config?.outDir || "dist";
83
+ };
79
84
  var isOutputServer = async () => {
80
85
  const config = await getEventCatalogConfigFile(process.env.PROJECT_DIR || "");
81
86
  return config?.output === "server";
@@ -214,6 +219,7 @@ var isEventCatalogStarterEnabled = async (licenseKey) => {
214
219
  };
215
220
  // Annotate the CommonJS export names for ESM import in node:
216
221
  0 && (module.exports = {
222
+ getProjectOutDir,
217
223
  isAuthEnabled,
218
224
  isBackstagePluginEnabled,
219
225
  isEventCatalogScaleEnabled,
@@ -1,7 +1,8 @@
1
+ declare const getProjectOutDir: () => Promise<any>;
1
2
  declare const isOutputServer: () => Promise<boolean>;
2
3
  declare const isAuthEnabled: () => Promise<boolean>;
3
4
  declare const isBackstagePluginEnabled: (licenseKey?: string) => Promise<boolean>;
4
5
  declare const isEventCatalogScaleEnabled: (licenseKey?: string) => Promise<boolean>;
5
6
  declare const isEventCatalogStarterEnabled: (licenseKey?: string) => Promise<boolean>;
6
7
 
7
- export { isAuthEnabled, isBackstagePluginEnabled, isEventCatalogScaleEnabled, isEventCatalogStarterEnabled, isOutputServer };
8
+ export { getProjectOutDir, isAuthEnabled, isBackstagePluginEnabled, isEventCatalogScaleEnabled, isEventCatalogStarterEnabled, isOutputServer };
@@ -1,7 +1,8 @@
1
+ declare const getProjectOutDir: () => Promise<any>;
1
2
  declare const isOutputServer: () => Promise<boolean>;
2
3
  declare const isAuthEnabled: () => Promise<boolean>;
3
4
  declare const isBackstagePluginEnabled: (licenseKey?: string) => Promise<boolean>;
4
5
  declare const isEventCatalogScaleEnabled: (licenseKey?: string) => Promise<boolean>;
5
6
  declare const isEventCatalogStarterEnabled: (licenseKey?: string) => Promise<boolean>;
6
7
 
7
- export { isAuthEnabled, isBackstagePluginEnabled, isEventCatalogScaleEnabled, isEventCatalogStarterEnabled, isOutputServer };
8
+ export { getProjectOutDir, isAuthEnabled, isBackstagePluginEnabled, isEventCatalogScaleEnabled, isEventCatalogStarterEnabled, isOutputServer };
package/dist/features.js CHANGED
@@ -1,12 +1,14 @@
1
1
  import {
2
+ getProjectOutDir,
2
3
  isAuthEnabled,
3
4
  isBackstagePluginEnabled,
4
5
  isEventCatalogScaleEnabled,
5
6
  isEventCatalogStarterEnabled,
6
7
  isOutputServer
7
- } from "./chunk-LUUBKWYP.js";
8
+ } from "./chunk-MCSZBCOG.js";
8
9
  import "./chunk-E7TXTI7G.js";
9
10
  export {
11
+ getProjectOutDir,
10
12
  isAuthEnabled,
11
13
  isBackstagePluginEnabled,
12
14
  isEventCatalogScaleEnabled,
@@ -2,7 +2,6 @@ import { defineConfig } from 'astro/config';
2
2
  import tailwind from '@astrojs/tailwind';
3
3
  import mdx from '@astrojs/mdx';
4
4
  import react from '@astrojs/react';
5
- import pagefind from "astro-pagefind";
6
5
  import { mermaid } from "./src/remark-plugins/mermaid"
7
6
  import { plantuml } from "./src/remark-plugins/plantuml"
8
7
  import { join } from 'node:path';
@@ -76,7 +75,6 @@ export default defineConfig({
76
75
  ],
77
76
  gfm: true,
78
77
  }),
79
- config.output !== 'server' && pagefind(),
80
78
  config.output !== 'server' && compress && (await import("astro-compress")).default({
81
79
  Logger: 0,
82
80
  CSS: false,
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  import catalog from '@utils/eventcatalog-config/catalog';
3
- import Search from '@components/Search.astro';
3
+ import Search from '@components/Search/Search.astro';
4
4
  import { buildUrl } from '@utils/url-builder';
5
5
  import { showEventCatalogBranding, showCustomBranding } from '@utils/feature';
6
6
  import { getSession } from 'auth-astro/server';
@@ -0,0 +1,102 @@
1
+ ---
2
+ import MagnifyingGlassIcon from '@heroicons/react/24/outline/MagnifyingGlassIcon';
3
+ import SearchModal from './SearchModal.tsx';
4
+ ---
5
+
6
+ <link href="/pagefind/pagefind-ui.css" rel="stylesheet" />
7
+ <script type="module">
8
+ // Load Pagefind and expose it globally
9
+ import * as pagefind from '/pagefind/pagefind.js';
10
+
11
+ window.pagefind = pagefind;
12
+ window.dispatchEvent(new CustomEvent('pagefindLoaded'));
13
+ </script>
14
+
15
+ <div>
16
+ <div class="relative flex items-center">
17
+ <input
18
+ id="search-dummy-input"
19
+ type="text"
20
+ name="search"
21
+ placeholder="Search EventCatalog"
22
+ class="block w-full rounded-md caret-transparent border-0 py-1.5 pr-14 pl-10 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 font-light sm:text-sm sm:leading-6 px-4"
23
+ />
24
+ <MagnifyingGlassIcon className="absolute inset-y-0 -left-1 h-9 w-8 flex items-center pl-4 text-gray-400" />
25
+ <div class="absolute inset-y-0 right-0 flex py-1.5 pr-1.5">
26
+ <kbd class="inline-flex items-center rounded px-1 font-sans text-xs text-gray-400">⌘K</kbd>
27
+ </div>
28
+ </div>
29
+ </div>
30
+
31
+ <SearchModal client:only />
32
+
33
+ <script>
34
+ // Create a global state for the search modal
35
+ (window as any).searchModalState = {
36
+ isOpen: false,
37
+ toggle: function () {
38
+ this.isOpen = !this.isOpen;
39
+ this.render();
40
+ },
41
+ close: function () {
42
+ this.isOpen = false;
43
+ this.render();
44
+ },
45
+ render: function () {
46
+ // This will be handled by React component
47
+ const event = new CustomEvent('searchModalToggle', {
48
+ detail: { isOpen: this.isOpen },
49
+ });
50
+ window.dispatchEvent(event);
51
+ },
52
+ };
53
+
54
+ const dummyInput = document.getElementById('search-dummy-input');
55
+ const header = document.getElementById('eventcatalog-header');
56
+ const verticalNav = document.getElementById('eventcatalog-vertical-nav');
57
+
58
+ // Event listeners
59
+ window.addEventListener('keydown', (event) => {
60
+ if ((event.metaKey || event.ctrlKey) && event.key === 'k') {
61
+ event.preventDefault();
62
+ dummyInput?.click();
63
+ }
64
+ });
65
+
66
+ dummyInput?.addEventListener('click', function (e) {
67
+ e.preventDefault();
68
+ this.blur();
69
+ (window as any).searchModalState.toggle();
70
+ });
71
+
72
+ // Listen for modal state changes to update page elements
73
+ window.addEventListener('searchModalToggle', (event) => {
74
+ // Handle custom docs sidebars
75
+ const customDocsSidebars = document.querySelectorAll('aside[class*="fixed"][class*="z-10"]');
76
+
77
+ if ((event as any).detail.isOpen) {
78
+ if (header) header.classList.remove('backdrop-blur-sm');
79
+ if (verticalNav) verticalNav.style.zIndex = '-100';
80
+ // Hide custom docs sidebars when modal opens
81
+ customDocsSidebars.forEach((sidebar: any) => {
82
+ sidebar.style.zIndex = '-100';
83
+ });
84
+ } else {
85
+ if (header) header.classList.add('backdrop-blur-sm');
86
+ if (verticalNav) verticalNav.style.zIndex = '10';
87
+ // Restore custom docs sidebars when modal closes
88
+ customDocsSidebars.forEach((sidebar: any) => {
89
+ sidebar.style.zIndex = '10';
90
+ });
91
+ }
92
+ });
93
+ </script>
94
+
95
+ <style>
96
+ .line-clamp-2 {
97
+ display: -webkit-box;
98
+ -webkit-line-clamp: 2;
99
+ -webkit-box-orient: vertical;
100
+ overflow: hidden;
101
+ }
102
+ </style>