@eventcatalog/core 3.0.0-beta.8 → 3.0.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.
- package/README.md +41 -98
- package/dist/__mocks__/astro-content.cjs +32 -0
- package/dist/__mocks__/astro-content.d.cts +13 -0
- package/dist/__mocks__/astro-content.d.ts +13 -0
- package/dist/__mocks__/astro-content.js +7 -0
- 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 -19
- package/dist/catalog-to-astro-content-directory.d.cts +1 -2
- package/dist/catalog-to-astro-content-directory.d.ts +1 -2
- package/dist/catalog-to-astro-content-directory.js +3 -5
- package/dist/{chunk-R2BJ7MJG.js → chunk-6Z6ARMQS.js} +1 -17
- package/dist/{chunk-LQUXA3NB.js → chunk-BYP43AAT.js} +1 -1
- package/dist/{chunk-UTHNQFM7.js → chunk-E5Q7TZYT.js} +1 -1
- package/dist/{chunk-KEYJ3FB3.js → chunk-EKGR533N.js} +1 -1
- package/dist/{chunk-7MCE4J6I.js → chunk-KF5PARQK.js} +1 -1
- package/dist/{chunk-I3QUYHIK.js → chunk-VO5WYA44.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +20 -64
- package/dist/eventcatalog.config.d.cts +4 -0
- package/dist/eventcatalog.config.d.ts +4 -0
- package/dist/eventcatalog.js +26 -52
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/astro.config.mjs +4 -1
- package/eventcatalog/integrations/eventcatalog-features.ts +69 -0
- package/eventcatalog/public/icons/asyncapi-black.svg +2 -0
- package/eventcatalog/public/icons/graphql-black.svg +1 -0
- package/eventcatalog/public/icons/openapi-black.svg +1 -0
- package/eventcatalog/src/components/ChatPanel/ChatPanel.tsx +994 -0
- package/eventcatalog/src/components/ChatPanel/ChatPanelButton.tsx +24 -0
- package/eventcatalog/src/components/Grids/DomainGrid.tsx +310 -173
- package/eventcatalog/src/components/Grids/MessageGrid.tsx +299 -180
- package/eventcatalog/src/components/Grids/specification-utils.ts +106 -0
- package/eventcatalog/src/components/Header.astro +25 -5
- package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.tsx +14 -3
- package/eventcatalog/src/components/SchemaExplorer/ApiAccessSection.tsx +95 -90
- package/eventcatalog/src/components/SchemaExplorer/ApiContentViewer.tsx +144 -0
- package/eventcatalog/src/components/SchemaExplorer/Pagination.tsx +34 -8
- package/eventcatalog/src/components/SchemaExplorer/SchemaContentViewer.tsx +2 -2
- package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsHeader.tsx +140 -109
- package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsPanel.tsx +5 -14
- package/eventcatalog/src/components/SchemaExplorer/SchemaExplorer.tsx +247 -59
- package/eventcatalog/src/components/SchemaExplorer/SchemaFilters.tsx +64 -126
- package/eventcatalog/src/components/SchemaExplorer/SchemaListItem.tsx +41 -43
- package/eventcatalog/src/components/Search/Search.astro +2 -2
- package/eventcatalog/src/components/Search/SearchDataLoader.astro +25 -0
- package/eventcatalog/src/components/SideNav/NestedSideBar/SearchBar.tsx +6 -3
- package/eventcatalog/src/components/SideNav/NestedSideBar/index.tsx +44 -16
- package/eventcatalog/src/components/SideNav/SideNav.astro +0 -15
- package/eventcatalog/src/components/Tables/Table.tsx +96 -77
- package/eventcatalog/src/components/Tables/columns/ContainersTableColumns.tsx +108 -74
- package/eventcatalog/src/components/Tables/columns/DomainTableColumns.tsx +74 -55
- package/eventcatalog/src/components/Tables/columns/FlowTableColumns.tsx +36 -36
- package/eventcatalog/src/components/Tables/columns/MessageTableColumns.tsx +110 -77
- package/eventcatalog/src/components/Tables/columns/ServiceTableColumns.tsx +105 -94
- package/eventcatalog/src/components/Tables/columns/SharedColumns.tsx +31 -26
- package/eventcatalog/src/components/Tables/columns/TeamsTableColumns.tsx +115 -215
- package/eventcatalog/src/components/Tables/columns/UserTableColumns.tsx +145 -243
- package/eventcatalog/src/content.config.ts +1 -13
- package/eventcatalog/src/enterprise/ai/chat-api.ts +360 -0
- package/eventcatalog/src/enterprise/auth/[...auth].ts +3 -0
- package/eventcatalog/src/enterprise/auth/login.astro +420 -0
- package/eventcatalog/src/enterprise/collections/index.ts +0 -1
- package/eventcatalog/src/layouts/Footer.astro +8 -5
- package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +133 -117
- package/eventcatalog/src/pages/_index.astro +243 -559
- package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/_index.data.ts +8 -2
- package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/index.astro +9 -5
- package/eventcatalog/src/pages/directory/[type]/index.astro +6 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/asyncapi/[filename].astro +19 -3
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/changelog/index.astro +7 -7
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/graphql/[filename].astro +1 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +10 -7
- package/eventcatalog/src/pages/docs/[type]/[id]/language/index.astro +194 -121
- package/eventcatalog/src/pages/docs/teams/[id]/index.astro +94 -70
- package/eventcatalog/src/pages/docs/teams/[id].mdx.ts +36 -0
- package/eventcatalog/src/pages/docs/users/[id]/index.astro +56 -45
- package/eventcatalog/src/pages/docs/users/[id].mdx.ts +36 -0
- package/eventcatalog/src/pages/schemas/explorer/_index.data.ts +178 -0
- package/eventcatalog/src/pages/schemas/explorer/index.astro +7 -157
- package/eventcatalog/src/pages/studio.astro +124 -72
- package/eventcatalog/src/remark-plugins/directives.ts +30 -9
- package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/container.ts +10 -1
- package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/domain.ts +17 -7
- package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/message.ts +10 -1
- package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/service.ts +11 -4
- package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/shared.ts +14 -0
- package/eventcatalog/src/stores/{sidebar-store.ts → sidebar-store/index.ts} +1 -1
- package/eventcatalog/src/utils/collections/channels.ts +0 -2
- package/eventcatalog/src/utils/collections/commands.ts +0 -2
- package/eventcatalog/src/utils/collections/containers.ts +0 -2
- package/eventcatalog/src/utils/collections/domains.ts +0 -2
- package/eventcatalog/src/utils/collections/entities.ts +0 -2
- package/eventcatalog/src/utils/collections/events.ts +0 -2
- package/eventcatalog/src/utils/collections/flows.ts +0 -2
- package/eventcatalog/src/utils/collections/queries.ts +0 -2
- package/eventcatalog/src/utils/collections/schemas.ts +45 -7
- package/eventcatalog/src/utils/collections/services.ts +0 -2
- package/eventcatalog/src/utils/feature.ts +9 -5
- package/eventcatalog/src/utils/node-graphs/services-node-graph.ts +1 -1
- package/eventcatalog/src/utils/resource-files.ts +86 -0
- package/package.json +12 -15
- package/default-files-for-collections/changelogs.md +0 -5
- package/default-files-for-collections/channels.md +0 -8
- package/default-files-for-collections/commands.md +0 -8
- package/default-files-for-collections/domains.md +0 -8
- package/default-files-for-collections/events.md +0 -8
- package/default-files-for-collections/flows.md +0 -11
- package/default-files-for-collections/queries.md +0 -8
- package/default-files-for-collections/services.md +0 -8
- package/default-files-for-collections/ubiquitousLanguages.md +0 -7
- package/eventcatalog/src/enterprise/collections/chat-prompts.ts +0 -32
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/Chat.tsx +0 -60
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/ChatMessage.tsx +0 -414
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/ChatSidebar.tsx +0 -169
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/InputModal.tsx +0 -244
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/MentionInput.tsx +0 -211
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/WelcomePromptArea.tsx +0 -176
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/default-prompts.ts +0 -93
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/hooks/ChatProvider.tsx +0 -143
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/windows/ChatWindow.server.tsx +0 -387
- package/eventcatalog/src/enterprise/eventcatalog-chat/pages/api/chat.ts +0 -59
- package/eventcatalog/src/enterprise/eventcatalog-chat/pages/chat/index.astro +0 -104
- package/eventcatalog/src/enterprise/eventcatalog-chat/providers/ai-provider.ts +0 -140
- package/eventcatalog/src/enterprise/eventcatalog-chat/providers/anthropic.ts +0 -28
- package/eventcatalog/src/enterprise/eventcatalog-chat/providers/google.ts +0 -41
- package/eventcatalog/src/enterprise/eventcatalog-chat/providers/index.ts +0 -26
- package/eventcatalog/src/enterprise/eventcatalog-chat/providers/openai.ts +0 -61
- package/eventcatalog/src/enterprise/eventcatalog-chat/utils/chat-prompts.ts +0 -50
- package/eventcatalog/src/pages/auth/login.astro +0 -280
- package/eventcatalog/src/pages/chat/feature.astro +0 -179
- package/eventcatalog/src/pages/chat/index.astro +0 -10
- package/eventcatalog/src/pages/docs/_default-docs.mdx +0 -25
- package/eventcatalog/src/pages/docs/index.astro +0 -33
- package/eventcatalog/src/pages/nav-index.json.ts +0 -30
- /package/eventcatalog/src/{pages → enterprise}/auth/error.astro +0 -0
- /package/eventcatalog/src/{middleware-auth.ts → enterprise/auth/middleware/middleware-auth.ts} +0 -0
- /package/eventcatalog/src/{middleware.ts → enterprise/auth/middleware/middleware.ts} +0 -0
- /package/eventcatalog/src/{pages/unauthorized/index.astro → enterprise/auth/unauthorized.astro} +0 -0
- /package/eventcatalog/src/{pages → enterprise}/plans/index.astro +0 -0
- /package/eventcatalog/src/{components/SideNav/NestedSideBar → stores/sidebar-store}/builders/flow.ts +0 -0
- /package/eventcatalog/src/{components/SideNav/NestedSideBar/sidebar-builder.ts → stores/sidebar-store/state.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
<h1>📖 EventCatalog</h1>
|
|
4
|
-
<h3>The open source tool to help you discover and document your event-driven architectures</h3>
|
|
5
|
-
|
|
6
|
-
[![MIT License][license-badge]][license]
|
|
7
|
-
[![PRs Welcome][prs-badge]][prs]
|
|
8
|
-
<img src="https://img.shields.io/github/actions/workflow/status/event-catalog/eventcatalog/verify-build.yml"/>
|
|
9
|
-
[](https://discord.gg/3rjaZMmrAm) [<img src="https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white" height="20px" />](https://www.linkedin.com/in/david-boyne/) [](https://eda-visuals.boyney.io/?utm_source=event-catalog-gihub)
|
|
3
|
+
<!-- <h1>📖 EventCatalog</h1> -->
|
|
4
|
+
<!-- <h3>The open source tool to help you discover and document your event-driven architectures</h3> -->
|
|
10
5
|
|
|
11
6
|
|
|
12
7
|
|
|
@@ -25,134 +20,82 @@
|
|
|
25
20
|
|
|
26
21
|
<!-- <hr /> -->
|
|
27
22
|
|
|
28
|
-
<!-- <img width="745" alt="Screenshot 2024-12-13 at 09 56 05" src="https://github.com/user-attachments/assets/f537ec1f-54ee-4de1-996c-c6b72191be39" /> -->
|
|
29
|
-
<img width="745" alt="EventCatalog" src="./images/example.png" />
|
|
30
|
-
|
|
31
23
|
|
|
32
24
|
|
|
25
|
+
<img width="745" alt="EventCatalog" src="./images/example.png" />
|
|
33
26
|
|
|
34
|
-
<
|
|
27
|
+
<p align="center">
|
|
28
|
+
<br/>
|
|
29
|
+
<a href="https://eventcatalog.dev">EventCatalog</a> is a documentation tool for software architectures —
|
|
30
|
+
<br/>
|
|
31
|
+
bring discoverability to complex systems.
|
|
32
|
+
<br/><br/>
|
|
33
|
+
</p>
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
[](#contributors-)
|
|
38
|
-
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
35
|
+
<div align="center">
|
|
39
36
|
|
|
40
|
-
[
|
|
37
|
+
[](https://github.com/event-catalog/eventcatalog/actions/workflows/verify-build.yml)
|
|
38
|
+
[](https://github.com/event-catalog/eventcatalog/blob/main/LICENSE)
|
|
39
|
+
[](https://badge.fury.io/js/@eventcatalog/core)
|
|
41
40
|
|
|
42
41
|
</div>
|
|
43
42
|
|
|
44
|
-
<hr/>
|
|
45
|
-
|
|
46
|
-
# Core Features
|
|
47
|
-
|
|
48
|
-
- 📃 Document domains, services and messages ([demo](https://demo.eventcatalog.dev/docs))
|
|
49
|
-
- 📊 Visualise your architecture ([demo](https://demo.eventcatalog.dev/visualiser/domains/Orders))
|
|
50
|
-
- ⭐ Supports any Schema format (e.g Avro, JSON) ([demo](https://demo.eventcatalog.dev/docs/events/OrderConfirmed/0.0.1))
|
|
51
|
-
- 🗂️ Document any code examples (Any code snippet)
|
|
52
|
-
- 💅 Custom MDX components ([read more](https://eventcatalog.dev/docs/development/components/using-components))
|
|
53
|
-
- 🗄️ Version domains, services and messages
|
|
54
|
-
- ⭐ Discoverability feature (search, filter and more) ([demo](https://demo.eventcatalog.dev/discover/events))
|
|
55
|
-
- ⭐ Document teams and users ([demo](https://demo.eventcatalog.dev/docs/teams/full-stack))
|
|
56
|
-
- 🤖 Automate your catalogs with [generators](https://www.eventcatalog.dev/docs/development/plugins/plugin-overview) (e.g generate your catalogs from your [AsyncAPI](https://www.eventcatalog.dev/docs/asyncapi)/[OpenAPI](https://www.eventcatalog.dev/docs/openapi) documents)
|
|
57
|
-
- 👨🏼💻 Follows [Docs as code](https://www.writethedocs.org/guide/docs-as-code/) principles
|
|
58
|
-
- ⭐ And much more...
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
# The problem
|
|
62
|
-
|
|
63
|
-
Event-driven architectures are becoming more popular, giving us the ability to write decoupled architectures and use messages as away to communicate between domains/teams.
|
|
64
|
-
|
|
65
|
-
When starting with event-driven architectures you may have a handful of services and messages. As this scales with your team and organization it becomes very hard to manage and govern this.
|
|
66
43
|
|
|
67
|
-
|
|
44
|
+
<!--
|
|
68
45
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
Read more on these blogposts and videos:
|
|
76
|
-
|
|
77
|
-
- [Introducing EventCatalog v2 (2024)](https://eventcatalog.dev/blog/eventcatalog-v2)
|
|
78
|
-
- [Introducing EventCatalog v1 (2022)](https://www.boyney.io/blog/2022-01-11-introducing-eventcatalog)
|
|
79
|
-
- [Event-Driven Architecture: Beyond the Schema Registry (blog)](https://www.boyney.io/blog/2021-12-05-documenting-events)
|
|
80
|
-
- [Complexity is the Gotcha of Event-driven Architecture (VIDEO) by David Boyne](https://www.youtube.com/watch?v=VLUvfIm9wnQ&t=1s)
|
|
81
|
-
|
|
82
|
-
# This solution
|
|
46
|
+
[![MIT License][license-badge]][license]
|
|
47
|
+
[![PRs Welcome][prs-badge]][prs]
|
|
48
|
+
<img src="https://img.shields.io/github/actions/workflow/status/event-catalog/eventcatalog/verify-build.yml"/>
|
|
49
|
+
[](https://discord.gg/3rjaZMmrAm) [<img src="https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white" height="20px" />](https://www.linkedin.com/in/david-boyne/) [](https://eda-visuals.boyney.io/?utm_source=event-catalog-gihub)
|
|
50
|
+
-->
|
|
83
51
|
|
|
84
|
-
Think of EventCatalog as a website generator that allows you to document your event architectures powered by markdown.
|
|
85
52
|
|
|
86
|
-
EventCatalog is focused on discovery and documentation and allows you to:
|
|
87
53
|
|
|
88
|
-
- Document Domains/Services/Messages/Schemas/Code Examples and more...
|
|
89
|
-
- Visually shows relationships between upstream/downstream services using your Events
|
|
90
|
-
- Allows you to version your documentation and supports changelogs
|
|
91
|
-
- Add owners to domains,services and messages so your teams know who owns which parts of your domain
|
|
92
|
-
- And much more...
|
|
93
54
|
|
|
94
|
-
EventCatalog is technology agnostic, which means you can integrate your Catalog with any EDA technology of your choice and any schema formats.
|
|
95
55
|
|
|
96
|
-
|
|
56
|
+
<!--
|
|
97
57
|
|
|
98
|
-
|
|
58
|
+
<h4>Features: Documentation for Event Driven Architectures, Integration with any broker, Generator from your OpenAPI and AsyncAPI documents, Docs and Code, Markdown driven, Document Domains/Services/Messages/Schemas and more, Content versioning, Assign Owners, Schemas, OpenAPI, MDX Components and more...</h4> -->
|
|
99
59
|
|
|
100
|
-
|
|
60
|
+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
61
|
+
<!-- [](#contributors-) -->
|
|
62
|
+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
101
63
|
|
|
102
|
-
|
|
64
|
+
<!-- [Read the Docs](https://www.eventcatalog.dev/docs/development/getting-started/introduction) | [View Demo](https://demo.eventcatalog.dev) -->
|
|
103
65
|
|
|
104
|
-
|
|
66
|
+
</div>
|
|
105
67
|
|
|
106
|
-
|
|
68
|
+
## Install
|
|
107
69
|
|
|
70
|
+
The **recommended** way to install the latest version of EventCatalog is by running the command below:
|
|
108
71
|
```
|
|
109
72
|
npx @eventcatalog/create-eventcatalog@latest my-catalog
|
|
110
73
|
```
|
|
111
74
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
Here is an example of a Retail system using domains, services and messages.
|
|
75
|
+
Looking for help? Start with our [Getting Started](https://www.eventcatalog.dev/docs/development/starting-a-new-project/installation) guide
|
|
115
76
|
|
|
116
|
-
|
|
77
|
+
## Documentation
|
|
78
|
+
Visit our [official documentation](https://www.eventcatalog.dev/docs/development/getting-started).
|
|
117
79
|
|
|
118
|
-
|
|
80
|
+
## Support
|
|
81
|
+
Having trouble? Get help in the official [EventCatalog Discord](https://discord.gg/3rjaZMmrAm).
|
|
119
82
|
|
|
120
|
-
|
|
83
|
+
## Demos
|
|
121
84
|
|
|
122
|
-
|
|
85
|
+
Here are some examples of EventCatalog in action:
|
|
123
86
|
|
|
124
|
-
|
|
87
|
+
- [Finance System](https://eventcatalog-examples-finance.vercel.app/)
|
|
88
|
+
- [Healthcare System](https://eventcatalog-examples-healthcare.vercel.app/)
|
|
89
|
+
- [E-Commerce System](https://demo.eventcatalog.dev/)
|
|
90
|
+
- [SaaS System](https://eventcatalog-examples-saas.vercel.app/)
|
|
125
91
|
|
|
126
|
-
# Looking for v1?
|
|
127
92
|
|
|
128
|
-
|
|
129
|
-
- Code: https://github.com/event-catalog/eventcatalog/tree/v1
|
|
130
|
-
|
|
131
|
-
_Still using v1 of EventCatalog? We recommnded upgrading to the latest version. [Read more in the migration guide](https://eventcatalog.dev/docs/development/guides/upgrading-from-version-1)._
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
# Contributing
|
|
93
|
+
## Contributing
|
|
135
94
|
|
|
136
95
|
If you have any questions, features or issues please raise any issue or pull requests you like. We will try my best to get back to you.
|
|
137
96
|
|
|
138
97
|
You can find the [contributing guidelines here](https://eventcatalog.dev/docs/contributing/overview).
|
|
139
98
|
|
|
140
|
-
## Running the project locally
|
|
141
|
-
|
|
142
|
-
1. Clone the repo
|
|
143
|
-
1. Install required dependencies `pnpm install`
|
|
144
|
-
1. Run the command `pnpm run start:catalog`
|
|
145
|
-
- This will start the catalog found in `/examples` repo, locally on your machine
|
|
146
|
-
|
|
147
|
-
[license-badge]: https://img.shields.io/github/license/event-catalog/eventcatalog.svg?color=yellow
|
|
148
|
-
[license]: https://github.com/event-catalog/eventcatalog/blob/main/LICENSE
|
|
149
|
-
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
|
|
150
|
-
[prs]: http://makeapullrequest.com
|
|
151
|
-
[github-watch-badge]: https://img.shields.io/github/watchers/event-catalog/eventcatalog.svg?style=social
|
|
152
|
-
[github-watch]: https://github.com/event-catalog/eventcatalog/watchers
|
|
153
|
-
[github-star-badge]: https://img.shields.io/github/stars/event-catalog/eventcatalog.svg?style=social
|
|
154
|
-
[github-star]: https://github.com/event-catalog/eventcatalog/stargazers
|
|
155
|
-
|
|
156
99
|
## Contributors ✨
|
|
157
100
|
|
|
158
101
|
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/__mocks__/astro-content.ts
|
|
21
|
+
var astro_content_exports = {};
|
|
22
|
+
__export(astro_content_exports, {
|
|
23
|
+
getCollection: () => getCollection
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(astro_content_exports);
|
|
26
|
+
var getCollection = async (key, filter) => {
|
|
27
|
+
return [];
|
|
28
|
+
};
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
getCollection
|
|
32
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const getCollection: (key: string, filter?: (entry: any) => boolean) => Promise<never[]>;
|
|
2
|
+
type ContentCollectionKey = 'events' | 'services' | 'commands' | 'queries' | 'domains' | 'channels' | 'flows' | 'messages' | 'entities' | 'schemas';
|
|
3
|
+
type CollectionEntry<T extends ContentCollectionKey> = {
|
|
4
|
+
id: string;
|
|
5
|
+
slug: string;
|
|
6
|
+
body: string;
|
|
7
|
+
collection: T;
|
|
8
|
+
data: any;
|
|
9
|
+
filePath?: string;
|
|
10
|
+
render?: () => Promise<any>;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { type CollectionEntry, type ContentCollectionKey, getCollection };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const getCollection: (key: string, filter?: (entry: any) => boolean) => Promise<never[]>;
|
|
2
|
+
type ContentCollectionKey = 'events' | 'services' | 'commands' | 'queries' | 'domains' | 'channels' | 'flows' | 'messages' | 'entities' | 'schemas';
|
|
3
|
+
type CollectionEntry<T extends ContentCollectionKey> = {
|
|
4
|
+
id: string;
|
|
5
|
+
slug: string;
|
|
6
|
+
body: string;
|
|
7
|
+
collection: T;
|
|
8
|
+
data: any;
|
|
9
|
+
filePath?: string;
|
|
10
|
+
render?: () => Promise<any>;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { type CollectionEntry, type ContentCollectionKey, getCollection };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-KF5PARQK.js";
|
|
4
|
+
import "../chunk-VO5WYA44.js";
|
|
5
|
+
import "../chunk-BYP43AAT.js";
|
|
6
6
|
import "../chunk-UPONRQSN.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
|
@@ -30,8 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/catalog-to-astro-content-directory.js
|
|
31
31
|
var catalog_to_astro_content_directory_exports = {};
|
|
32
32
|
__export(catalog_to_astro_content_directory_exports, {
|
|
33
|
-
catalogToAstro: () => catalogToAstro
|
|
34
|
-
checkAndConvertMdToMdx: () => checkAndConvertMdToMdx
|
|
33
|
+
catalogToAstro: () => catalogToAstro
|
|
35
34
|
});
|
|
36
35
|
module.exports = __toCommonJS(catalog_to_astro_content_directory_exports);
|
|
37
36
|
|
|
@@ -241,23 +240,7 @@ var catalogToAstro = async (source, astroDir) => {
|
|
|
241
240
|
}
|
|
242
241
|
await copyFiles(source, astroDir);
|
|
243
242
|
};
|
|
244
|
-
var checkAndConvertMdToMdx = async (source, astroDir) => {
|
|
245
|
-
const files = await (0, import_glob.glob)(path3.join(source, "**"), {
|
|
246
|
-
nodir: true,
|
|
247
|
-
windowsPathsNoEscape: import_node_os.default.platform() == "win32",
|
|
248
|
-
ignore: ["node_modules/**", "**/dist/**", "**/README.md"]
|
|
249
|
-
});
|
|
250
|
-
if (files.some((file) => file.endsWith(".md"))) {
|
|
251
|
-
console.log(`EventCatalog now requires all markdown files to be .mdx files. Converting all .md files to .mdx...`);
|
|
252
|
-
}
|
|
253
|
-
for (const file of files) {
|
|
254
|
-
if (file.endsWith(".md")) {
|
|
255
|
-
import_fs.default.renameSync(file, file.replace(".md", ".mdx"));
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
243
|
// Annotate the CommonJS export names for ESM import in node:
|
|
260
244
|
0 && (module.exports = {
|
|
261
|
-
catalogToAstro
|
|
262
|
-
checkAndConvertMdToMdx
|
|
245
|
+
catalogToAstro
|
|
263
246
|
});
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
catalogToAstro
|
|
3
|
-
|
|
4
|
-
} from "./chunk-R2BJ7MJG.js";
|
|
2
|
+
catalogToAstro
|
|
3
|
+
} from "./chunk-6Z6ARMQS.js";
|
|
5
4
|
import "./chunk-55D645EH.js";
|
|
6
5
|
import "./chunk-UPONRQSN.js";
|
|
7
6
|
export {
|
|
8
|
-
catalogToAstro
|
|
9
|
-
checkAndConvertMdToMdx
|
|
7
|
+
catalogToAstro
|
|
10
8
|
};
|
|
@@ -50,23 +50,7 @@ var catalogToAstro = async (source, astroDir) => {
|
|
|
50
50
|
}
|
|
51
51
|
await copyFiles(source, astroDir);
|
|
52
52
|
};
|
|
53
|
-
var checkAndConvertMdToMdx = async (source, astroDir) => {
|
|
54
|
-
const files = await glob(path.join(source, "**"), {
|
|
55
|
-
nodir: true,
|
|
56
|
-
windowsPathsNoEscape: os.platform() == "win32",
|
|
57
|
-
ignore: ["node_modules/**", "**/dist/**", "**/README.md"]
|
|
58
|
-
});
|
|
59
|
-
if (files.some((file) => file.endsWith(".md"))) {
|
|
60
|
-
console.log(`EventCatalog now requires all markdown files to be .mdx files. Converting all .md files to .mdx...`);
|
|
61
|
-
}
|
|
62
|
-
for (const file of files) {
|
|
63
|
-
if (file.endsWith(".md")) {
|
|
64
|
-
fs.renameSync(file, file.replace(".md", ".mdx"));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
53
|
|
|
69
54
|
export {
|
|
70
|
-
catalogToAstro
|
|
71
|
-
checkAndConvertMdToMdx
|
|
55
|
+
catalogToAstro
|
|
72
56
|
};
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -109,7 +109,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
109
109
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
110
110
|
|
|
111
111
|
// package.json
|
|
112
|
-
var version = "3.0.0
|
|
112
|
+
var version = "3.0.0";
|
|
113
113
|
|
|
114
114
|
// src/constants.ts
|
|
115
115
|
var VERSION = version;
|
|
@@ -479,21 +479,6 @@ var catalogToAstro = async (source, astroDir) => {
|
|
|
479
479
|
}
|
|
480
480
|
await copyFiles(source, astroDir);
|
|
481
481
|
};
|
|
482
|
-
var checkAndConvertMdToMdx = async (source, astroDir) => {
|
|
483
|
-
const files = await (0, import_glob.glob)(path4.join(source, "**"), {
|
|
484
|
-
nodir: true,
|
|
485
|
-
windowsPathsNoEscape: import_node_os.default.platform() == "win32",
|
|
486
|
-
ignore: ["node_modules/**", "**/dist/**", "**/README.md"]
|
|
487
|
-
});
|
|
488
|
-
if (files.some((file) => file.endsWith(".md"))) {
|
|
489
|
-
console.log(`EventCatalog now requires all markdown files to be .mdx files. Converting all .md files to .mdx...`);
|
|
490
|
-
}
|
|
491
|
-
for (const file of files) {
|
|
492
|
-
if (file.endsWith(".md")) {
|
|
493
|
-
import_fs.default.renameSync(file, file.replace(".md", ".mdx"));
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
};
|
|
497
482
|
|
|
498
483
|
// src/resolve-catalog-dependencies.js
|
|
499
484
|
var import_node_path4 = __toESM(require("path"), 1);
|
|
@@ -547,11 +532,6 @@ var isOutputServer = async () => {
|
|
|
547
532
|
const config = await getEventCatalogConfigFile(process.env.PROJECT_DIR || "");
|
|
548
533
|
return config?.output === "server";
|
|
549
534
|
};
|
|
550
|
-
var isAuthEnabled = async () => {
|
|
551
|
-
const directory = process.env.PROJECT_DIR || process.cwd();
|
|
552
|
-
const hasAuthConfig = import_node_fs4.default.existsSync((0, import_node_path5.join)(directory, "eventcatalog.auth.js"));
|
|
553
|
-
return hasAuthConfig;
|
|
554
|
-
};
|
|
555
535
|
|
|
556
536
|
// src/eventcatalog.ts
|
|
557
537
|
var import_update_notifier = __toESM(require("update-notifier"), 1);
|
|
@@ -702,47 +682,31 @@ var copyCore = () => {
|
|
|
702
682
|
}
|
|
703
683
|
});
|
|
704
684
|
};
|
|
705
|
-
var copyServerFiles = async () => {
|
|
706
|
-
const isServerOutput = await isOutputServer();
|
|
707
|
-
if (import_fs2.default.existsSync((0, import_node_path7.join)(core, "src/pages/api/server"))) {
|
|
708
|
-
import_fs2.default.rmSync((0, import_node_path7.join)(core, "src/pages/api/server"), { recursive: true });
|
|
709
|
-
}
|
|
710
|
-
if (!isServerOutput) {
|
|
711
|
-
if (import_fs2.default.existsSync((0, import_node_path7.join)(core, "src/pages/api/chat.ts"))) {
|
|
712
|
-
import_fs2.default.rmSync((0, import_node_path7.join)(core, "src/pages/api/chat.ts"));
|
|
713
|
-
}
|
|
714
|
-
if (import_fs2.default.existsSync((0, import_node_path7.join)(core, "src/pages/api/[...auth].ts"))) {
|
|
715
|
-
import_fs2.default.rmSync((0, import_node_path7.join)(core, "src/pages/api/[...auth].ts"));
|
|
716
|
-
}
|
|
717
|
-
return;
|
|
718
|
-
}
|
|
719
|
-
import_fs2.default.cpSync((0, import_node_path7.join)(eventCatalogDir, "src/enterprise/eventcatalog-chat/pages/api"), (0, import_node_path7.join)(core, "src/pages/api"), {
|
|
720
|
-
recursive: true
|
|
721
|
-
});
|
|
722
|
-
};
|
|
723
|
-
var createAuthFileIfNotExists = async (hasRequiredLicense) => {
|
|
724
|
-
const authEnabled = await isAuthEnabled();
|
|
725
|
-
const isSRR = await isOutputServer();
|
|
726
|
-
try {
|
|
727
|
-
if (authEnabled && hasRequiredLicense && isSRR) {
|
|
728
|
-
logger.info("Creating auth file", "auth");
|
|
729
|
-
import_fs2.default.writeFileSync(
|
|
730
|
-
(0, import_node_path7.join)(core, "src/pages/api/[...auth].ts"),
|
|
731
|
-
`import { AstroAuth } from 'auth-astro/server';
|
|
732
|
-
export const prerender = false;
|
|
733
|
-
export const { GET, POST } = AstroAuth();
|
|
734
|
-
`
|
|
735
|
-
);
|
|
736
|
-
}
|
|
737
|
-
} catch (error) {
|
|
738
|
-
}
|
|
739
|
-
};
|
|
740
685
|
var clearCore = () => {
|
|
741
686
|
if (import_fs2.default.existsSync(core)) import_fs2.default.rmSync(core, { recursive: true });
|
|
742
687
|
};
|
|
743
688
|
var checkForUpdate = () => {
|
|
744
689
|
const installedVersion = getInstalledEventCatalogVersion();
|
|
745
690
|
if (!installedVersion) return;
|
|
691
|
+
const majorVersion = parseInt(installedVersion.replace(/[^0-9.]/g, "").split(".")[0], 10);
|
|
692
|
+
if (majorVersion < 3) {
|
|
693
|
+
const v3Message = `\u{1F680} EventCatalog V3 is now available in beta!
|
|
694
|
+
|
|
695
|
+
You are currently on version ${installedVersion}.
|
|
696
|
+
V3 brings exciting new features and improvements.
|
|
697
|
+
|
|
698
|
+
Upgrade now: npm i @eventcatalog/core@beta`;
|
|
699
|
+
console.log(
|
|
700
|
+
(0, import_boxen.default)(v3Message, {
|
|
701
|
+
padding: 1,
|
|
702
|
+
margin: 1,
|
|
703
|
+
align: "center",
|
|
704
|
+
borderColor: "magenta",
|
|
705
|
+
borderStyle: "round"
|
|
706
|
+
})
|
|
707
|
+
);
|
|
708
|
+
return;
|
|
709
|
+
}
|
|
746
710
|
const pkg = { name: "@eventcatalog/core", version: installedVersion };
|
|
747
711
|
const notifier = (0, import_update_notifier.default)({ pkg, updateCheckInterval: 0 });
|
|
748
712
|
if (notifier.update) {
|
|
@@ -784,17 +748,14 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
784
748
|
if (options.forceRecreate) clearCore();
|
|
785
749
|
copyCore();
|
|
786
750
|
await resolve_catalog_dependencies_default(dir, core);
|
|
787
|
-
await checkAndConvertMdToMdx(dir, core);
|
|
788
751
|
await runMigrations(dir);
|
|
789
752
|
await catalogToAstro(dir, core);
|
|
790
|
-
await copyServerFiles();
|
|
791
753
|
const canEmbedPages = await (0, import_license.isFeatureEnabled)(
|
|
792
754
|
"@eventcatalog/backstage-plugin-eventcatalog",
|
|
793
755
|
process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
|
|
794
756
|
);
|
|
795
757
|
const isEventCatalogStarter = await (0, import_license.isEventCatalogStarterEnabled)();
|
|
796
758
|
const isEventCatalogScale = await (0, import_license.isEventCatalogScaleEnabled)();
|
|
797
|
-
await createAuthFileIfNotExists(isEventCatalogScale);
|
|
798
759
|
checkForUpdate();
|
|
799
760
|
let watchUnsub;
|
|
800
761
|
try {
|
|
@@ -835,7 +796,6 @@ program.command("build").description("Run build of EventCatalog").action(async (
|
|
|
835
796
|
import_dotenv.default.config({ path: import_node_path8.default.join(dir, ".env") });
|
|
836
797
|
}
|
|
837
798
|
copyCore();
|
|
838
|
-
await copyServerFiles();
|
|
839
799
|
const isBackstagePluginEnabled = await (0, import_license.isFeatureEnabled)(
|
|
840
800
|
"@eventcatalog/backstage-plugin-eventcatalog",
|
|
841
801
|
process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
|
|
@@ -843,14 +803,12 @@ program.command("build").description("Run build of EventCatalog").action(async (
|
|
|
843
803
|
const isEventCatalogStarter = await (0, import_license.isEventCatalogStarterEnabled)();
|
|
844
804
|
const isEventCatalogScale = await (0, import_license.isEventCatalogScaleEnabled)();
|
|
845
805
|
const canEmbedPages = isBackstagePluginEnabled || isEventCatalogScale;
|
|
846
|
-
await createAuthFileIfNotExists(isEventCatalogScale);
|
|
847
806
|
await log_build_default(dir, {
|
|
848
807
|
isEventCatalogStarterEnabled: isEventCatalogStarter,
|
|
849
808
|
isEventCatalogScaleEnabled: isEventCatalogScale,
|
|
850
809
|
isBackstagePluginEnabled: canEmbedPages || isEventCatalogScale
|
|
851
810
|
});
|
|
852
811
|
await resolve_catalog_dependencies_default(dir, core);
|
|
853
|
-
await checkAndConvertMdToMdx(dir, core);
|
|
854
812
|
await runMigrations(dir);
|
|
855
813
|
await catalogToAstro(dir, core);
|
|
856
814
|
checkForUpdate();
|
|
@@ -905,8 +863,6 @@ program.command("preview").description("Serves the contents of your eventcatalog
|
|
|
905
863
|
);
|
|
906
864
|
const isEventCatalogStarter = await (0, import_license.isEventCatalogStarterEnabled)();
|
|
907
865
|
const isEventCatalogScale = await (0, import_license.isEventCatalogScaleEnabled)();
|
|
908
|
-
await copyServerFiles();
|
|
909
|
-
await createAuthFileIfNotExists(isEventCatalogScale);
|
|
910
866
|
previewCatalog({ command, canEmbedPages: canEmbedPages || isEventCatalogScale, isEventCatalogStarter, isEventCatalogScale });
|
|
911
867
|
});
|
|
912
868
|
program.command("start").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
|
|
@@ -44,6 +44,9 @@ type PagesConfiguration = {
|
|
|
44
44
|
icon?: string;
|
|
45
45
|
pages?: string[];
|
|
46
46
|
};
|
|
47
|
+
type AuthConfig = {
|
|
48
|
+
enabled: boolean;
|
|
49
|
+
};
|
|
47
50
|
interface Config {
|
|
48
51
|
title: string;
|
|
49
52
|
tagline: false;
|
|
@@ -57,6 +60,7 @@ interface Config {
|
|
|
57
60
|
host?: string;
|
|
58
61
|
trailingSlash?: boolean;
|
|
59
62
|
output?: 'server' | 'static';
|
|
63
|
+
auth?: AuthConfig;
|
|
60
64
|
rss?: {
|
|
61
65
|
enabled: boolean;
|
|
62
66
|
limit: number;
|
|
@@ -44,6 +44,9 @@ type PagesConfiguration = {
|
|
|
44
44
|
icon?: string;
|
|
45
45
|
pages?: string[];
|
|
46
46
|
};
|
|
47
|
+
type AuthConfig = {
|
|
48
|
+
enabled: boolean;
|
|
49
|
+
};
|
|
47
50
|
interface Config {
|
|
48
51
|
title: string;
|
|
49
52
|
tagline: false;
|
|
@@ -57,6 +60,7 @@ interface Config {
|
|
|
57
60
|
host?: string;
|
|
58
61
|
trailingSlash?: boolean;
|
|
59
62
|
output?: 'server' | 'static';
|
|
63
|
+
auth?: AuthConfig;
|
|
60
64
|
rss?: {
|
|
61
65
|
enabled: boolean;
|
|
62
66
|
limit: number;
|