@eventcatalog/core 0.0.2 → 0.0.6

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,8 +1,31 @@
1
1
  # @eventcatalog/core
2
2
 
3
- ## 0.0.2
3
+ ## 0.0.6
4
+
4
5
  ### Patch Changes
5
6
 
7
+ - [`ad66a66`](https://github.com/boyney123/eventcatalog/commit/ad66a66b526a167cc8da43dd2371642c9f9029f2) [#49](https://github.com/boyney123/eventcatalog/pull/49) Thanks [@boyney123](https://github.com/boyney123)! - fix: now supports any extension for event examples also added missing docs
8
+
9
+ ## 0.0.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`576debd`](https://github.com/boyney123/eventcatalog/commit/576debdfc5dbc2fbbf98e2b3f4d78b84f9a07669) [#46](https://github.com/boyney123/eventcatalog/pull/46) Thanks [@boyney123](https://github.com/boyney123)! - fix: using cross-env to fix issues with windows OS
14
+
15
+ ## 0.0.4
16
+
17
+ ### Patch Changes
6
18
 
19
+ - [`1eb4572`](https://github.com/boyney123/eventcatalog/commit/1eb4572918ac06afb64554fef2fc1a3877fbf06d) [#44](https://github.com/boyney123/eventcatalog/pull/44) Thanks [@boyney123](https://github.com/boyney123)! - feat: added more customise options and documentation for them
20
+
21
+ ## 0.0.3
22
+
23
+ ### Patch Changes
24
+
25
+ - [`23a96fc`](https://github.com/boyney123/eventcatalog/commit/23a96fc651907517cee937657be14cbf9fe95fb9) [#42](https://github.com/boyney123/eventcatalog/pull/42) Thanks [@boyney123](https://github.com/boyney123)! - fix: now remove the .next folder before we start the dev server foric…
26
+
27
+ ## 0.0.2
28
+
29
+ ### Patch Changes
7
30
 
8
31
  - [`53b27cb`](https://github.com/boyney123/eventcatalog/commit/53b27cb5bb5ab7fa8d526309c6dd50e1f17f3db1) [#39](https://github.com/boyney123/eventcatalog/pull/39) Thanks [@boyney123](https://github.com/boyney123)! - feat: removed ids from services
@@ -38,7 +38,7 @@ cli
38
38
  .command('start [siteDir]')
39
39
  .description('Start the development server.')
40
40
  .action(() => {
41
- execSync(`PROJECT_DIR=${projectDIR} npm run start`, {
41
+ execSync(`cross-env PROJECT_DIR=${projectDIR} npm run start`, {
42
42
  cwd: eventCatalogLibDir,
43
43
  stdio: 'inherit',
44
44
  });
@@ -56,7 +56,7 @@ cli
56
56
  fs.copySync(path.join(projectDIR, 'public'), path.join(eventCatalogLibDir, 'public'));
57
57
 
58
58
  // build using nextjs
59
- execSync(`PROJECT_DIR=${projectDIR} npm run build`, {
59
+ execSync(`cross-env PROJECT_DIR=${projectDIR} npm run build`, {
60
60
  cwd: eventCatalogLibDir,
61
61
  stdio: 'inherit',
62
62
  });
@@ -69,9 +69,10 @@ cli
69
69
  .command('dev [siteDir]')
70
70
  .description('Start the development server.')
71
71
  .action(() => {
72
- if (!fs.existsSync(eventCatalogLibDir)) {
73
- copyCoreApplicationCodeIntoUsersProjectDir();
74
- }
72
+ // Fix for https://github.com/boyney123/eventcatalog/issues/41, not the best but will do for now
73
+ fs.rmSync(eventCatalogLibDir, { recursive: true, force: true });
74
+
75
+ copyCoreApplicationCodeIntoUsersProjectDir();
75
76
 
76
77
  // copy any public assets over (from users to the lib itself)
77
78
  fs.copySync(path.join(projectDIR, 'public'), path.join(eventCatalogLibDir, 'public'));
@@ -81,7 +82,7 @@ cli
81
82
  path.join(eventCatalogLibDir, 'eventcatalog.config.js')
82
83
  );
83
84
 
84
- execSync(`PROJECT_DIR=${projectDIR} npm run dev`, {
85
+ execSync(`cross-env PROJECT_DIR=${projectDIR} npm run dev`, {
85
86
  cwd: eventCatalogLibDir,
86
87
  stdio: 'inherit',
87
88
  });
@@ -102,7 +103,7 @@ cli
102
103
  path.join(eventCatalogLibDir, 'eventcatalog.config.js')
103
104
  );
104
105
 
105
- execSync(`PROJECT_DIR=${projectDIR} npm run generate`, {
106
+ execSync(`cross-env PROJECT_DIR=${projectDIR} npm run generate`, {
106
107
  cwd: eventCatalogLibDir,
107
108
  stdio: 'inherit',
108
109
  });
@@ -2,30 +2,23 @@ import React from 'react';
2
2
  import { useConfig } from '@/hooks/EventCatalog';
3
3
 
4
4
  export default function Footer() {
5
- const { organizationName, editUrl } = useConfig();
5
+ const { organizationName, footerLinks: navigation = [] } = useConfig();
6
6
  const year = new Date().getFullYear();
7
7
 
8
- const navigation = {
9
- main: [
10
- { name: 'Events', href: '/events' },
11
- { name: 'Services', href: '/services' },
12
- { name: '3D Node Graph', href: '/overview' },
13
- { name: 'GitHub', href: editUrl },
14
- ],
15
- };
16
-
17
8
  return (
18
9
  <footer className="bg-gray-800">
19
10
  <div className="max-w-7xl mx-auto py-12 px-4 overflow-hidden sm:px-6 lg:px-8">
20
- <nav className="-mx-5 -my-2 flex flex-wrap justify-center" aria-label="Footer">
21
- {navigation.main.map((item) => (
22
- <div key={item.name} className="px-5 py-2">
23
- <a href={item.href} className="text-base text-gray-500 hover:text-gray-900">
24
- {item.name}
25
- </a>
26
- </div>
27
- ))}
28
- </nav>
11
+ {navigation && (
12
+ <nav className="-mx-5 -my-2 flex flex-wrap justify-center" aria-label="Footer">
13
+ {navigation.map((item) => (
14
+ <div key={item.label} className="px-5 py-2">
15
+ <a href={item.href} className="text-base text-gray-500 hover:text-gray-900">
16
+ {item.label}
17
+ </a>
18
+ </div>
19
+ ))}
20
+ </nav>
21
+ )}
29
22
  <p className="mt-8 text-center text-base text-gray-400">
30
23
  Copyright © {year} {organizationName}. Built with{' '}
31
24
  <a className="underline" href="https://eventcatalog.dev" target="_blank" rel="noreferrer">
@@ -17,7 +17,7 @@ interface AdmonitionProps {
17
17
  className?: string;
18
18
  }
19
19
 
20
- export default function Admonition({ children, type, className }: AdmonitionProps) {
20
+ export default function Admonition({ children, type, className = '' }: AdmonitionProps) {
21
21
  const { color, icon: Icon } = getConfigurationByType(type);
22
22
 
23
23
  return (
@@ -111,7 +111,7 @@ function EventSideBar({ event, loadedVersion }: EventSideBarProps) {
111
111
  ? 'bg-blue-400 text-white shadow-md font-bold underline'
112
112
  : 'bg-blue-100 text-blue-800';
113
113
  return (
114
- <li className="text-sm inline ">
114
+ <li className="text-sm inline" key={version}>
115
115
  <Link href={`/events/${eventName}/v/${version}`}>
116
116
  <a>
117
117
  <span
@@ -137,7 +137,7 @@ function ServiceSidebar({ service }: ServiceSideBarProps) {
137
137
  <div className="space-y-3">
138
138
  <h2 className="text-sm font-medium text-gray-500">Language</h2>
139
139
  {languages.map((value) => (
140
- <div className="relative flex items-center mt-2">
140
+ <div className="relative flex items-center mt-2" key={value}>
141
141
  <div className="absolute flex-shrink-0 flex items-center justify-center">
142
142
  <span
143
143
  className="h-2 w-2 rounded-full"
package/lib/events.ts CHANGED
@@ -120,7 +120,7 @@ const getEventExamplesFromDir = (pathToExamples) => {
120
120
  return {
121
121
  name: filename,
122
122
  snippet: content,
123
- langugage: extentionToLanguageMap[extension],
123
+ langugage: extentionToLanguageMap[extension] || extension,
124
124
  };
125
125
  });
126
126
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eventcatalog/core",
3
- "version": "0.0.2",
3
+ "version": "0.0.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,7 +37,7 @@
37
37
  "react-syntax-highlighter": "^15.4.5"
38
38
  },
39
39
  "devDependencies": {
40
- "@eventcatalog/types": "0.0.1",
40
+ "@eventcatalog/types": "0.0.2",
41
41
  "@types/react": "^17.0.36",
42
42
  "autoprefixer": "^10.4.0",
43
43
  "commander": "^8.3.0",
@@ -46,6 +46,7 @@
46
46
  "postcss": "^8.3.11",
47
47
  "tailwindcss": "^2.2.19",
48
48
  "trim": "0.0.3",
49
+ "cross-env": "^7.0.3",
49
50
  "typescript": "^4.4.4"
50
51
  },
51
52
  "gitHead": "5f82ce7f267e9b3ec771bbd3cc81359ed0a8fd18"
package/pages/_app.tsx CHANGED
@@ -16,7 +16,7 @@ export default ({ Component, pageProps }: AppProps) => (
16
16
  name="description"
17
17
  content="An open source project to Discover, Explore and Document your Event Driven Architectures."
18
18
  />
19
- <meta property="og:url" content="https://demo.eventcatalog.dev/" />
19
+ <meta property="og:url" content="https://eventcatalog.dev/" />
20
20
  <meta property="og:type" content="website" />
21
21
  <meta
22
22
  property="og:title"
@@ -26,7 +26,7 @@ export default ({ Component, pageProps }: AppProps) => (
26
26
  property="og:description"
27
27
  content="An open source tool powered by markdown to document your Event Driven Architecture."
28
28
  />
29
- <meta property="og:image" content="https://demo.eventcatalog.dev/opengraph.png" />
29
+ <meta property="og:image" content="https://eventcatalog.dev/img/opengraph.png" />
30
30
  <meta
31
31
  property="og:image:alt"
32
32
  content="EventCatalog | Discover, Explore and Document your Event Driven Architectures."
@@ -56,7 +56,15 @@ export const getComponents = ({ event, schema, examples }: any) => ({
56
56
  );
57
57
  },
58
58
  Admonition,
59
- EventExamples: (props) => <Examples {...props} examples={examples} showLineNumbers />,
59
+ EventExamples: (props) => {
60
+ if (examples.length > 0) {
61
+ return <Examples {...props} examples={examples} showLineNumbers />;
62
+ }
63
+ console.log(
64
+ 'You are using the <EventExamples /> component without any examples, please read https://eventcatalog.dev/docs/events/adding-examples for more information'
65
+ );
66
+ return null;
67
+ },
60
68
  Mermaid: ({ title }: { title: string }) => (
61
69
  <div className="mx-auto w-full py-10">
62
70
  {title && <h2 className="text-lg font-medium text-gray-900 underline">{title}</h2>}