@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 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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eventcatalog/core",
3
3
  "type": "module",
4
- "version": "2.0.30",
4
+ "version": "2.1.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -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') {
@@ -0,0 +1,5 @@
1
+ ---
2
+ id: index
3
+ ---
4
+
5
+ <!-- Do not delete this file, required for EC, you an ignore this file -->
@@ -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={`whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 ${cell.column.columnDef.meta?.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>
@@ -55,6 +55,7 @@ export const columns = () => [
55
55
  footer: (info) => info.column.id,
56
56
  meta: {
57
57
  showFilter: false,
58
+ className: 'max-w-md',
58
59
  },
59
60
  }),
60
61
  columnHelper.accessor('data.services', {
@@ -57,6 +57,7 @@ export const columns = () => [
57
57
  footer: (info) => info.column.id,
58
58
  meta: {
59
59
  showFilter: false,
60
+ className: 'max-w-md',
60
61
  },
61
62
  }),
62
63
 
@@ -56,6 +56,7 @@ export const columns = () => [
56
56
  footer: (info) => info.column.id,
57
57
  meta: {
58
58
  showFilter: false,
59
+ className: 'max-w-md',
59
60
  },
60
61
  }),
61
62
  columnHelper.accessor('data.receives', {
@@ -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
  };
@@ -27,7 +27,7 @@ import SEO from '../components/Seo.astro';
27
27
  </div>
28
28
  </nav>
29
29
 
30
- <div class="pl-0 sm:pl-64 lg:pl-72 xl:pl-80 w-full pt-0 pb-40">
30
+ <div class="pl-0 sm:pl-64 lg:pl-72 xl:pl-80 w-full pt-0 pb-40 ">
31
31
  <slot />
32
32
  </div>
33
33
  </div>
@@ -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(&quot;/icons/github.svg&quot;); 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(&quot;/icons/x-twitter.svg&quot;); 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
+ };
@@ -1,4 +0,0 @@
1
- ---
2
- layout: ../../layouts/CustomDocsPageLayout.astro
3
- ---
4
-