@eventcatalog/core 2.0.30 → 2.1.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/CHANGELOG.md +12 -0
- package/package.json +1 -1
- package/scripts/catalog-to-astro-content-directory.js +10 -0
- package/scripts/default-files-for-collections/pages.md +5 -0
- package/scripts/watcher.js +1 -1
- package/src/components/MDX/page-components.tsx +8 -0
- package/src/components/Tables/Table.tsx +1 -1
- package/src/components/Tables/columns/DomainTableColumns.tsx +1 -0
- package/src/components/Tables/columns/MessageTableColumns.tsx +1 -0
- package/src/components/Tables/columns/ServiceTableColumns.tsx +1 -0
- package/src/content/config.ts +8 -1
- package/src/layouts/DocsLayout.astro +1 -1
- package/src/pages/docs/index.astro +40 -0
- package/src/utils/pages.ts +15 -0
- package/src/pages/docs/index.md +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @eventcatalog/core
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 35fa4a3: feat(core): added ability to customize the landing page
|
|
8
|
+
|
|
9
|
+
## 2.0.31
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- c4f6f40: fix(core): discover table width now fixed on long summarys
|
|
14
|
+
|
|
3
15
|
## 2.0.30
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -187,6 +187,16 @@ export const catalogToAstro = async (source, astroContentDir, catalogFilesDir) =
|
|
|
187
187
|
pathToAllFiles: [],
|
|
188
188
|
type: 'teams',
|
|
189
189
|
});
|
|
190
|
+
|
|
191
|
+
// // Copy all the pages (optional)
|
|
192
|
+
await copyFiles({
|
|
193
|
+
source,
|
|
194
|
+
target: astroContentDir,
|
|
195
|
+
catalogFilesDir,
|
|
196
|
+
pathToMarkdownFiles: [path.join(source, 'pages/**/*.md')],
|
|
197
|
+
pathToAllFiles: [],
|
|
198
|
+
type: 'pages',
|
|
199
|
+
});
|
|
190
200
|
};
|
|
191
201
|
|
|
192
202
|
if (process.env.NODE_ENV !== 'test') {
|
package/scripts/watcher.js
CHANGED
|
@@ -10,7 +10,7 @@ const catalogDirectory = process.env.CATALOG_DIR;
|
|
|
10
10
|
|
|
11
11
|
const contentPath = path.join(catalogDirectory, 'src', 'content');
|
|
12
12
|
|
|
13
|
-
const watchList = ['domains', 'commands', 'events', 'services', 'teams', 'users'];
|
|
13
|
+
const watchList = ['domains', 'commands', 'events', 'services', 'teams', 'users', 'pages'];
|
|
14
14
|
// const absoluteWatchList = watchList.map((item) => path.join(projectDirectory, item));
|
|
15
15
|
|
|
16
16
|
// confirm folders exist before watching them
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const components = {
|
|
2
|
+
a: (mdxProp: any) => <a className="text-purple-500" {...mdxProp} />,
|
|
3
|
+
h1: (mdxProp: any) => <h1 className="mb-4" {...mdxProp} />,
|
|
4
|
+
h3: (mdxProp: any) => <h3 className="mb-2" {...mdxProp} />,
|
|
5
|
+
p: (mdxProp: any) => <p className="my-3" {...mdxProp} />,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export default components;
|
|
@@ -90,7 +90,7 @@ export const Table = ({
|
|
|
90
90
|
{row.getVisibleCells().map((cell) => (
|
|
91
91
|
<td
|
|
92
92
|
key={cell.id}
|
|
93
|
-
className={`
|
|
93
|
+
className={` py-4 pl-4 pr-3 text-sm font-medium text-gray-900 ${cell.column.columnDef.meta?.className}`}
|
|
94
94
|
>
|
|
95
95
|
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
96
96
|
</td>
|
package/src/content/config.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import catalog from '@eventcatalog';
|
|
2
1
|
import { z, defineCollection, reference } from 'astro:content';
|
|
3
2
|
|
|
4
3
|
const badge = z.object({
|
|
@@ -7,6 +6,13 @@ const badge = z.object({
|
|
|
7
6
|
textColor: z.string(),
|
|
8
7
|
});
|
|
9
8
|
|
|
9
|
+
const pages = defineCollection({
|
|
10
|
+
type: 'content',
|
|
11
|
+
schema: z.object({
|
|
12
|
+
id: z.string(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
|
|
10
16
|
// Create a union type for owners
|
|
11
17
|
const ownerReference = z.union([reference('users'), reference('teams')]);
|
|
12
18
|
|
|
@@ -116,4 +122,5 @@ export const collections = {
|
|
|
116
122
|
users,
|
|
117
123
|
teams,
|
|
118
124
|
domains,
|
|
125
|
+
pages,
|
|
119
126
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Layout from '@layouts/DocsLayout.astro';
|
|
3
|
+
import DefaultDocsLandingPage from '@layouts/CustomDocsPageLayout.astro';
|
|
4
|
+
import components from '@components/MDX/page-components';
|
|
5
|
+
import { getIndexPage } from '@utils/pages';
|
|
6
|
+
|
|
7
|
+
const page = await getIndexPage();
|
|
8
|
+
let CustomContent = null;
|
|
9
|
+
|
|
10
|
+
if(page){
|
|
11
|
+
const { Content } = await page.render();
|
|
12
|
+
CustomContent = Content;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
{CustomContent &&
|
|
18
|
+
<Layout title="EventCatalog">
|
|
19
|
+
<main class="py-8">
|
|
20
|
+
<div class="prose prose-md w-full !max-w-none">
|
|
21
|
+
<CustomContent components={components} />
|
|
22
|
+
</div>
|
|
23
|
+
<footer class="py-4 space-y-8 border-t border-gray-300">
|
|
24
|
+
<div class="flex justify-between items-center py-8 text-gray-500 text-sm font-light">
|
|
25
|
+
<div class="flex space-x-5">
|
|
26
|
+
<a href="https://github.com/event-catalog/eventcatalog" target="_blank"><svg class="w-5 h-5 bg-gray-400 hover:bg-purple-500 dark:hover:bg-gray-400" style="mask-image: url("/icons/github.svg"); mask-repeat: no-repeat; mask-position: center center;"></svg></a>
|
|
27
|
+
<a href="https://x.com/event_catalog" target="_blank"><span class="sr-only">x</span><svg class="w-5 h-5 bg-gray-400 hover:bg-purple-500 dark:hover:bg-gray-400" style="mask-image: url("/icons/x-twitter.svg"); mask-repeat: no-repeat; mask-position: center center;"></svg></a>
|
|
28
|
+
</div>
|
|
29
|
+
<a target="_blank" class="hover:text-purple-500 hover:underline text-gray-400 font-light not-prose" href="https://eventcatalog.dev">Powered by EventCatalog</a>
|
|
30
|
+
</div>
|
|
31
|
+
</footer>
|
|
32
|
+
</main>
|
|
33
|
+
</Layout>
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
{!CustomContent &&
|
|
37
|
+
<DefaultDocsLandingPage title="EventCatalog" />
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { getCollection } from 'astro:content';
|
|
2
|
+
import type { CollectionEntry } from 'astro:content';
|
|
3
|
+
|
|
4
|
+
export type Page = CollectionEntry<'pages'>;
|
|
5
|
+
|
|
6
|
+
export const getPages = async (): Promise<Page[]> => {
|
|
7
|
+
// Get services that are not versioned
|
|
8
|
+
const pages = await getCollection('pages');
|
|
9
|
+
return pages;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const getIndexPage = async (): Promise<Page> => {
|
|
13
|
+
const pages = await getCollection('pages');
|
|
14
|
+
return pages.find((page) => page.slug === 'index')!;
|
|
15
|
+
};
|
package/src/pages/docs/index.md
DELETED