@eventcatalog/core 2.31.0 → 2.31.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.31.0";
40
+ var version = "2.31.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-I6OFOESY.js";
4
- import "../chunk-4S3UNXH2.js";
3
+ } from "../chunk-GHBJ372G.js";
4
+ import "../chunk-YUINCBLT.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.31.0";
109
+ var version = "2.31.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-D7LV5JLL.js";
4
- import "../chunk-I6OFOESY.js";
5
- import "../chunk-4S3UNXH2.js";
3
+ } from "../chunk-QR5UTYCE.js";
4
+ import "../chunk-GHBJ372G.js";
5
+ import "../chunk-YUINCBLT.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-4S3UNXH2.js";
3
+ } from "./chunk-YUINCBLT.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-I6OFOESY.js";
3
+ } from "./chunk-GHBJ372G.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.31.0";
2
+ var version = "2.31.1";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "2.31.0";
28
+ var version = "2.31.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-4S3UNXH2.js";
3
+ } from "./chunk-YUINCBLT.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.31.0";
160
+ var version = "2.31.1";
161
161
 
162
162
  // src/constants.ts
163
163
  var VERSION = version;
@@ -6,15 +6,15 @@ import {
6
6
  } from "./chunk-UKJ7F5WR.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-D7LV5JLL.js";
10
- import "./chunk-I6OFOESY.js";
9
+ } from "./chunk-QR5UTYCE.js";
10
+ import "./chunk-GHBJ372G.js";
11
11
  import {
12
12
  catalogToAstro,
13
13
  checkAndConvertMdToMdx
14
14
  } from "./chunk-7SI5EVOX.js";
15
15
  import {
16
16
  VERSION
17
- } from "./chunk-4S3UNXH2.js";
17
+ } from "./chunk-YUINCBLT.js";
18
18
  import {
19
19
  isBackstagePluginEnabled,
20
20
  isEventCatalogProEnabled
@@ -52,8 +52,7 @@ const catalogHasDefaultLandingPageForDocs = await hasLandingPageForDocs();
52
52
 
53
53
  const getDefaultUrl = (route: string, defaultValue: string) => {
54
54
  if (route === 'docs/custom') {
55
- const firstDoc = customDocs[0];
56
- return buildUrl(`/${route}/${firstDoc.id.replace('docs', '')}`);
55
+ return customDocs.length > 0 ? buildUrl(`/${route}/${customDocs[0].id.replace('docs', '')}`) : buildUrl(defaultValue);
57
56
  }
58
57
 
59
58
  const collections = [
@@ -63,7 +62,6 @@ const getDefaultUrl = (route: string, defaultValue: string) => {
63
62
  { data: commands, key: 'commands' },
64
63
  { data: queries, key: 'queries' },
65
64
  { data: flows, key: 'flows' },
66
- { data: customDocs, key: 'customDocs' },
67
65
  ];
68
66
 
69
67
  for (const { data, key } of collections) {
@@ -326,7 +324,7 @@ const canPageBeEmbedded = process.env.ENABLE_EMBED === 'true';
326
324
 
327
325
  const navItem = navigationItems.find((navItem) => navItem.id === id);
328
326
 
329
- if (!navItem.sidebar || !currentPath.includes(navItem.id)) {
327
+ if (!navItem.sidebar || !currentPath.includes(navItem.id) || currentPath.includes('/docs/custom')) {
330
328
  window.location.href = navItem.href;
331
329
  return;
332
330
  }
@@ -2,8 +2,6 @@
2
2
  import CustomDocumentationPage from '@enterprise/custom-documentation/pages/index.astro';
3
3
  import { getCollection } from 'astro:content';
4
4
  import type { GetStaticPaths } from 'astro';
5
- import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
6
- import { Code } from 'astro-expressive-code/components';
7
5
  import { isEventCatalogProEnabled } from '@utils/feature';
8
6
  import path from 'node:path';
9
7
  import fs from 'node:fs';
@@ -27,234 +25,10 @@ export const getStaticPaths = (async () => {
27
25
 
28
26
  const props = Astro.props;
29
27
 
30
- // Example for folder structure
31
- const folderStructureExample = `my-catalog/
32
- └── docs/
33
- ├── getting-started/
34
- │ ├── 01-introduction.mdx
35
- │ └── 02-quick-start.mdx
36
- ├── architecture-decisions/
37
- │ ├── 01-what-are-architecture-decisions.mdx
38
- │ ├── 02-how-to-create-architecture-decisions.mdx
39
- │ ├── published/
40
- │ │ ├── 01-adr-001-event-driven.mdx
41
- │ │ └── 02-adr-002-api-first.mdx
42
- │ └── drafts/
43
- │ ├── 01-adr-003-microservices.mdx
44
- │ └── 02-adr-004-monolith.mdx
45
- └`;
46
- // Example MDX file content
47
- const mdxFileExample = `---
48
- title: Getting Started
49
- description: How to get started with our event-driven architecture
50
- ---
51
-
52
- # Getting Started with our Event-Driven Architecture
53
-
54
- This guide will help you understand how our services communicate using events.
55
-
56
- ## Prerequisites
57
-
58
- - Understanding of basic messaging patterns
59
- - Node.js installed on your machine
60
-
61
- ## Key Concepts
62
-
63
- Events are the backbone of our architecture. They represent facts that have happened in our system.
64
- `;
65
-
66
- // Example config file
67
- const configExample = `// eventcatalog.config.js
68
-
69
- module.exports = {
70
- // Your existing config...
71
-
72
- customDocs: {
73
- sidebar: [
74
- {
75
- label: 'Getting Started',
76
- badge: {
77
- text: 'New', color: 'green'
78
- },
79
- collapsed: false,
80
- items: [
81
- { label: 'Introduction', slug: 'getting-started/01-introduction' },
82
- { label: 'Quick Start', slug: 'getting-started/02-quick-start' }
83
- ]
84
- },
85
- {
86
- label: 'Architecture Decisions',
87
- badge: {
88
- text: 'New', color: 'green'
89
- },
90
- collapsed: true,
91
- items: [
92
- {
93
- label: 'What are Architecture Decisions?',
94
- slug: 'architecture-decisions/01-what-are-architecture-decisions'
95
- },
96
- {
97
- label: 'How to Create Architecture Decisions',
98
- slug: 'architecture-decisions/02-how-to-create-architecture-decisions'
99
- },
100
- {
101
- label: 'Published ADRs',
102
- autogenerated: {
103
- directory: 'architecture-decisions/published',
104
- collapsed: true
105
- }
106
- },
107
- {
108
- label: 'Draft ADRs',
109
- autogenerated: {
110
- directory: 'architecture-decisions/drafts',
111
- collapsed: true
112
- }
113
- }
114
- ]
115
- }
116
- ]
117
- }
118
- }`;
28
+ // Redirect
29
+ if (!directoryExists || !isEventCatalogProEnabled()) {
30
+ Astro.redirect('/docs/custom');
31
+ }
119
32
  ---
120
33
 
121
- {
122
- directoryExists && isEventCatalogProEnabled() ? (
123
- <CustomDocumentationPage {...props} />
124
- ) : (
125
- <VerticalSideBarLayout title="Custom Documentation">
126
- <body class="min-h-screen font-inter">
127
- <main class="container px-8 lg:px-8 mx-auto py-8 max-w-[80em]">
128
- <div class="mb-12">
129
- <div class="flex flex-col md:flex-row md:items-center md:justify-between gap-6">
130
- <div>
131
- <div class="flex flex-wrap items-center gap-3 mb-3">
132
- <h1 class="text-4xl font-semibold text-gray-900 font-inter">Custom Documentation</h1>
133
- <div class="inline-flex items-center px-3 py-1.5 rounded-full text-xs font-medium bg-purple-100 text-purple-800 border border-purple-200 shadow-sm">
134
- Pro feature
135
- </div>
136
- </div>
137
- <p class="text-base mb-0 text-gray-600 max-w-3xl">
138
- Add custom documentation to EventCatalog to create a unified source of truth for your team. Document your
139
- architecture decisions, patterns, and guidelines.
140
- </p>
141
- </div>
142
- <div class="flex space-x-4 shrink-0">
143
- <a
144
- href="https://www.eventcatalog.dev/docs/custom-documentation"
145
- class="inline-flex items-center justify-center px-5 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"
146
- >
147
- Read documentation &rarr;
148
- </a>
149
- {!isEventCatalogProEnabled() && (
150
- <a
151
- href="https://www.eventcatalog.dev/pro/trial"
152
- class="inline-flex items-center justify-center px-5 py-2 border border-transparent text-sm font-medium rounded-md text-white bg-gradient-to-r from-purple-500 to-purple-700 hover:from-purple-600 hover:to-purple-800 shadow-sm"
153
- >
154
- Start 14-day trial
155
- </a>
156
- )}
157
- </div>
158
- </div>
159
- </div>
160
-
161
- <h2 class="text-2xl font-semibold mb-2 text-gray-900">Setup Guide</h2>
162
- <p class="text-gray-600 mb-8 max-w-3xl">
163
- Custom documentation let's you bring any documentation into EventCatalog. This is useful for documenting your
164
- architecture decisions, patterns, and guidelines. Follow these steps to get started:
165
- </p>
166
-
167
- <div class="space-y-10 mb-12">
168
- <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
169
- <div class="flex items-start gap-4">
170
- <div class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-blue-100 text-blue-600 text-lg font-medium shrink-0 mt-1">
171
- 1
172
- </div>
173
- <div class="w-full">
174
- <h3 class="text-xl font-semibold text-gray-900 mb-3">Create the content structure</h3>
175
- <p class="text-gray-600 mb-4">Create a folder structure in your directory to organize your documentation.</p>
176
- <Code code={folderStructureExample} lang="bash" frame="terminal" />
177
- </div>
178
- </div>
179
- </div>
180
-
181
- <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
182
- <div class="flex items-start gap-4">
183
- <div class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-blue-100 text-blue-600 text-lg font-medium shrink-0 mt-1">
184
- 2
185
- </div>
186
- <div class="w-full">
187
- <h3 class="text-xl font-semibold text-gray-900 mb-3">Add MDX files</h3>
188
- <p class="text-gray-600 mb-4">Create MDX files with frontmatter and markdown content.</p>
189
- <Code code={mdxFileExample} lang="mdx" frame="terminal" />
190
- </div>
191
- </div>
192
- </div>
193
-
194
- <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
195
- <div class="flex items-start gap-4">
196
- <div class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-blue-100 text-blue-600 text-lg font-medium shrink-0 mt-1">
197
- 3
198
- </div>
199
- <div class="w-full">
200
- <h3 class="text-xl font-semibold text-gray-900 mb-3">Update your eventcatalog.config.js file</h3>
201
- <p class="text-gray-600 mb-4">
202
- Add the customDocs configuration to your eventcatalog.config.js file to define your sidebar structure.
203
- </p>
204
- <Code code={configExample} lang="js" frame="terminal" />
205
- <p class="text-gray-600 mt-4">
206
- This configuration defines the sidebar structure for your custom documentation:
207
- </p>
208
- <ul class="list-disc list-inside text-gray-600 mt-2 ml-2 space-y-1">
209
- <li>
210
- <strong>label</strong>: The display name for each sidebar section
211
- </li>
212
- <li>
213
- <strong>badge</strong>: Optional badge to highlight new sections
214
- </li>
215
- <li>
216
- <strong>collapsed</strong>: Whether the section is collapsed by default
217
- </li>
218
- <li>
219
- <strong>autogenerated</strong>: Automatically generate sidebar items from a directory
220
- </li>
221
- <li>
222
- <strong>slug</strong>: Direct link to a specific page
223
- </li>
224
- </ul>
225
- </div>
226
- </div>
227
- </div>
228
-
229
- <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
230
- <div class="flex items-start gap-4">
231
- <div class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-blue-100 text-blue-600 text-lg font-medium shrink-0 mt-1">
232
- 4
233
- </div>
234
- <div class="w-full">
235
- <h3 class="text-xl font-semibold text-gray-900 mb-3">Restart EventCatalog</h3>
236
- <p class="text-gray-600 mb-4">
237
- After configuring your documentation, restart EventCatalog to see your custom documentation.
238
- </p>
239
- <div class="mb-4">
240
- <Code code="npm run dev" lang="bash" frame="terminal" />
241
- </div>
242
- <p class="text-gray-600 mb-4">
243
- Once restarted, you'll see your custom documentation displayed with the sidebar structure you defined:
244
- </p>
245
- <div class="border border-gray-200 rounded-lg overflow-hidden">
246
- <img
247
- src="/images/custom-docs-placeholder.png"
248
- alt="Example of custom documentation interface"
249
- class="w-full"
250
- />
251
- </div>
252
- </div>
253
- </div>
254
- </div>
255
- </div>
256
- </main>
257
- </body>
258
- </VerticalSideBarLayout>
259
- )
260
- }
34
+ <CustomDocumentationPage {...props} />
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.31.0",
9
+ "version": "2.31.1",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },