@eventcatalog/core 2.7.10 → 2.7.12
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
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eventcatalog/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.7.
|
|
4
|
+
"version": "2.7.12",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"test": "vitest --config vitest.config.ts",
|
|
17
17
|
"test:ci": "node scripts/ci/test.js",
|
|
18
18
|
"start": "astro dev",
|
|
19
|
-
"build": "npm run scripts:hydrate-content && astro check --minimumSeverity error && astro build",
|
|
19
|
+
"build": "npm run scripts:hydrate-content && node scripts/analytics/log-build.js && astro check --minimumSeverity error && astro build",
|
|
20
20
|
"build:cd": "node scripts/build-ci.js",
|
|
21
21
|
"preview": "astro preview",
|
|
22
22
|
"astro": "astro",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"astro-expressive-code": "^0.36.1",
|
|
50
50
|
"astro-pagefind": "^1.6.0",
|
|
51
51
|
"astro-seo": "^0.8.4",
|
|
52
|
+
"axios": "^1.7.7",
|
|
52
53
|
"dagre": "^0.8.5",
|
|
53
54
|
"diff": "^7.0.0",
|
|
54
55
|
"diff2html": "^3.4.48",
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import os from 'os';
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
|
|
6
|
+
async function getVersion() {
|
|
7
|
+
try {
|
|
8
|
+
const pkg = await fs.readFileSync(path.join(process.env.CATALOG_DIR, 'package.json'));
|
|
9
|
+
const parsed = JSON.parse(pkg);
|
|
10
|
+
return parsed.version;
|
|
11
|
+
} catch (error) {
|
|
12
|
+
console.log(error);
|
|
13
|
+
return 'unknown';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async function raiseEvent(eventData) {
|
|
18
|
+
const version = await getVersion();
|
|
19
|
+
|
|
20
|
+
const url = 'https://queue.simpleanalyticscdn.com/events';
|
|
21
|
+
const userAgent = `@eventcatalog/eventcatalog@${version} (${os.platform()}; ${os.arch()}; Node/${process.version})`;
|
|
22
|
+
const headers = {
|
|
23
|
+
'Content-Type': 'application/json',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const payload = {
|
|
27
|
+
type: 'event',
|
|
28
|
+
hostname: 'eventcatalog.dev',
|
|
29
|
+
event: '@eventcatalog/eventcatalog',
|
|
30
|
+
metadata: {
|
|
31
|
+
...eventData,
|
|
32
|
+
t: `t;${new Date().toISOString()}`,
|
|
33
|
+
ua: userAgent,
|
|
34
|
+
},
|
|
35
|
+
ua: userAgent,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
await axios.post(url, payload, { headers });
|
|
40
|
+
} catch (error) {
|
|
41
|
+
// swallow the error
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { raiseEvent };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getEventCatalogConfigFile, verifyRequiredFieldsAreInCatalogConfigFile } from '../eventcatalog-config-file-utils.js';
|
|
2
|
+
import { raiseEvent } from './analytics.js';
|
|
3
|
+
|
|
4
|
+
const main = async () => {
|
|
5
|
+
if (process.env.NODE_ENV === 'CI') return;
|
|
6
|
+
try {
|
|
7
|
+
await verifyRequiredFieldsAreInCatalogConfigFile(process.env.PROJECT_DIR);
|
|
8
|
+
const configFile = await getEventCatalogConfigFile(process.env.PROJECT_DIR);
|
|
9
|
+
const { cId, organizationName, generators = [] } = configFile;
|
|
10
|
+
const generatorNames = generators.length > 0 ? generators.map((generator) => generator[0]) : ['none'];
|
|
11
|
+
await raiseEvent({
|
|
12
|
+
command: 'build',
|
|
13
|
+
org: organizationName,
|
|
14
|
+
cId,
|
|
15
|
+
generators: generatorNames.toString(),
|
|
16
|
+
});
|
|
17
|
+
} catch (error) {
|
|
18
|
+
// Just swallow the error
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
main();
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentType } from 'react';
|
|
3
|
+
import * as Icons from '@heroicons/react/24/solid';
|
|
4
|
+
import { buildUrl } from '@utils/url-builder-client';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
href: string;
|
|
8
|
+
icon: keyof typeof Icons;
|
|
9
|
+
title: string;
|
|
10
|
+
openWindow?: boolean;
|
|
11
|
+
description: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const { href, icon, title, description, openWindow } = Astro.props;
|
|
15
|
+
|
|
16
|
+
const IconComponent: ComponentType<{ className?: string }> | undefined = Icons[icon];
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
<a
|
|
20
|
+
href={buildUrl(href)}
|
|
21
|
+
target={openWindow ? '_blank' : '_self'}
|
|
22
|
+
class="block bg-white border border-gray-200 rounded-lg p-6 transition-all duration-300 ease-in-out hover:shadow-md hover:border-purple-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-purple-500 focus:ring-white"
|
|
23
|
+
>
|
|
24
|
+
<div class="flex flex-col h-full space-y-8">
|
|
25
|
+
{IconComponent && <IconComponent className="w-6 h-6 text-purple-500" />}
|
|
26
|
+
<div>
|
|
27
|
+
<h2 class="text-gray-800 text-lg font-semibold transition-colors duration-300 ease-in-out group-hover:text-gray-300">
|
|
28
|
+
{title}
|
|
29
|
+
</h2>
|
|
30
|
+
<p class="text-gray-600 transition-colors duration-300 ease-in-out group-hover:text-gray-200 m-0 font-light text-sm">
|
|
31
|
+
{description}
|
|
32
|
+
</p>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</a>
|
|
@@ -4,6 +4,8 @@ import File from '@components/MDX/File';
|
|
|
4
4
|
import Accordion from '@components/MDX/Accordion/Accordion.astro';
|
|
5
5
|
import AccordionGroup from '@components/MDX/Accordion/AccordionGroup.astro';
|
|
6
6
|
import Flow from '@components/MDX/Flow/Flow.astro';
|
|
7
|
+
import Tiles from '@components/MDX/Tiles/Tiles.astro';
|
|
8
|
+
import Tile from '@components/MDX/Tiles/Tile.astro';
|
|
7
9
|
import Admonition from '@components/MDX/Admonition';
|
|
8
10
|
import OpenAPI from '@components/MDX/OpenAPI/OpenAPI.astro';
|
|
9
11
|
import AsyncAPI from '@components/MDX/AsyncAPI/AsyncAPI.astro';
|
|
@@ -19,6 +21,8 @@ const components = (props: any) => {
|
|
|
19
21
|
Flow,
|
|
20
22
|
OpenAPI,
|
|
21
23
|
AsyncAPI,
|
|
24
|
+
Tiles,
|
|
25
|
+
Tile,
|
|
22
26
|
Admonition: (mdxProp: any) => <Admonition {...mdxProp} {...props} />,
|
|
23
27
|
File: (mdxProp: any) => File({ ...props, ...mdxProp }),
|
|
24
28
|
NodeGraph: (mdxProp: any) => NodeGraphPortal({ ...props.data, ...mdxProp }),
|