@eventcatalog/core 0.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.
Files changed (62) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/README.md +11 -0
  3. package/bin/eventcatalog.js +125 -0
  4. package/components/BreadCrumbs.tsx +50 -0
  5. package/components/ContentView.tsx +127 -0
  6. package/components/Footer.tsx +38 -0
  7. package/components/Grids/EventGrid.tsx +89 -0
  8. package/components/Grids/ServiceGrid.tsx +70 -0
  9. package/components/Header.tsx +59 -0
  10. package/components/Mdx/Admonition.tsx +33 -0
  11. package/components/Mdx/Examples.tsx +77 -0
  12. package/components/Mermaid/index.tsx +47 -0
  13. package/components/NotFound/index.tsx +44 -0
  14. package/components/Sidebars/EventSidebar.tsx +202 -0
  15. package/components/Sidebars/ServiceSidebar.tsx +198 -0
  16. package/components/SyntaxHighlighter.tsx +34 -0
  17. package/hooks/EventCatalog.tsx +35 -0
  18. package/lib/__tests__/assets/events/AddedItemToCart/index.md +19 -0
  19. package/lib/__tests__/assets/events/EmailSent/index.md +15 -0
  20. package/lib/__tests__/assets/events/EventWithSchemaAndExamples/examples/Basic.cs +31 -0
  21. package/lib/__tests__/assets/events/EventWithSchemaAndExamples/examples/Basic.js +1 -0
  22. package/lib/__tests__/assets/events/EventWithSchemaAndExamples/index.md +8 -0
  23. package/lib/__tests__/assets/events/EventWithSchemaAndExamples/schema.json +4 -0
  24. package/lib/__tests__/assets/events/EventWithVersions/index.md +10 -0
  25. package/lib/__tests__/assets/events/EventWithVersions/versioned/0.0.1/index.md +10 -0
  26. package/lib/__tests__/assets/services/Email Platform/index.md +17 -0
  27. package/lib/__tests__/events.spec.ts +294 -0
  28. package/lib/__tests__/file-reader.spec.ts +57 -0
  29. package/lib/__tests__/graphs.spec.ts +62 -0
  30. package/lib/__tests__/services.spec.ts +144 -0
  31. package/lib/events.ts +221 -0
  32. package/lib/file-reader.ts +52 -0
  33. package/lib/graphs.ts +33 -0
  34. package/lib/services.ts +72 -0
  35. package/next-env.d.ts +5 -0
  36. package/next.config.js +3 -0
  37. package/package.json +52 -0
  38. package/pages/_app.tsx +49 -0
  39. package/pages/api/event/[name]/download.js +25 -0
  40. package/pages/events/[name]/logs.tsx +170 -0
  41. package/pages/events/[name]/v/[version].tsx +19 -0
  42. package/pages/events/[name].tsx +139 -0
  43. package/pages/events.tsx +227 -0
  44. package/pages/index.tsx +47 -0
  45. package/pages/overview.tsx +80 -0
  46. package/pages/services/[name].tsx +102 -0
  47. package/pages/services.tsx +123 -0
  48. package/pages/users/[id].tsx +83 -0
  49. package/postcss.config.js +6 -0
  50. package/public/favicon.ico +0 -0
  51. package/public/logo-random.svg +114 -0
  52. package/public/logo.svg +44 -0
  53. package/public/opengraph.png +0 -0
  54. package/scripts/__tests__/assets/eventcatalog.config.js +33 -0
  55. package/scripts/__tests__/generate.spec.ts +39 -0
  56. package/scripts/generate.js +28 -0
  57. package/styles/Home.module.css +116 -0
  58. package/styles/globals.css +48 -0
  59. package/tailwind.config.js +16 -0
  60. package/tsconfig.json +38 -0
  61. package/types/index.ts +7 -0
  62. package/utils/random-bg.ts +13 -0
package/tsconfig.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es5",
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "allowJs": true,
6
+ "skipLibCheck": true,
7
+ "strict": false,
8
+ "forceConsistentCasingInFileNames": true,
9
+ "noEmit": true,
10
+ "incremental": true,
11
+ "esModuleInterop": true,
12
+ "module": "esnext",
13
+ "moduleResolution": "node",
14
+ "resolveJsonModule": true,
15
+ "isolatedModules": true,
16
+ "baseUrl": ".",
17
+ "paths": {
18
+ "@/components/*": ["components/*"],
19
+ "@/modules/*": ["modules/*"],
20
+ "@/hooks/*": ["hooks/*"],
21
+ "@/types/*": ["types/*"],
22
+ "@/contexts/*": ["contexts/*"],
23
+ "@/data/*": ["data/*"],
24
+ "@/lib/*": ["lib/*"],
25
+ "@/utils/*": ["utils/*"],
26
+ "@/styles/*": ["styles/*"]
27
+ },
28
+ "jsx": "preserve"
29
+ },
30
+ "include": [
31
+ "next-env.d.ts",
32
+ "**/*.ts",
33
+ "**/*.tsx",
34
+ "hooks/EventCatalog.tsx",
35
+ "scripts/generate.js"
36
+ ],
37
+ "exclude": ["node_modules"]
38
+ }
package/types/index.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { MDXRemoteSerializeResult } from 'next-mdx-remote';
2
+
3
+ export interface MarkdownFile {
4
+ content: string;
5
+ source: MDXRemoteSerializeResult;
6
+ lastModifiedDate: string;
7
+ }
@@ -0,0 +1,13 @@
1
+ /* eslint-disable */
2
+ export default (str: string) => {
3
+ let hash = 0;
4
+ for (let i = 0; i < str.length; i++) {
5
+ hash = str.charCodeAt(i) + ((hash << 5) - hash);
6
+ }
7
+ let colour = '#';
8
+ for (let i = 0; i < 3; i++) {
9
+ const value = (hash >> (i * 8)) & 0xff;
10
+ colour += `00${value.toString(16)}`.substr(-2);
11
+ }
12
+ return colour;
13
+ };