@eventcatalog/core 4.2.0 → 4.2.1
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/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-QKPPJU43.js → chunk-A6SWOPJ4.js} +1 -1
- package/dist/{chunk-KPDU47YJ.js → chunk-DTQ2MXRB.js} +1 -1
- package/dist/{chunk-4FWALA6J.js → chunk-PUTZR6SV.js} +1 -1
- package/dist/{chunk-J7T5HUHY.js → chunk-RQ36O7QA.js} +1 -1
- package/dist/{chunk-47LY7DY2.js → chunk-V6UMVNX4.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +36 -23
- package/dist/eventcatalog.js +41 -28
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/src/pages/docs/[type]/[id]/[version].md.ts +3 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version].mdx.ts +4 -2
- package/eventcatalog/src/utils/file-diffs.ts +4 -2
- package/package.json +3 -3
|
@@ -140,7 +140,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
140
140
|
var import_os = __toESM(require("os"), 1);
|
|
141
141
|
|
|
142
142
|
// package.json
|
|
143
|
-
var version = "4.2.
|
|
143
|
+
var version = "4.2.1";
|
|
144
144
|
|
|
145
145
|
// src/constants.ts
|
|
146
146
|
var VERSION = version;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-V6UMVNX4.js";
|
|
4
|
+
import "../chunk-RQ36O7QA.js";
|
|
5
5
|
import "../chunk-K2XIENVT.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-PUTZR6SV.js";
|
|
7
7
|
import "../chunk-6QENHZZP.js";
|
|
8
8
|
export {
|
|
9
9
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -144,7 +144,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
144
144
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
145
145
|
|
|
146
146
|
// package.json
|
|
147
|
-
var version = "4.2.
|
|
147
|
+
var version = "4.2.1";
|
|
148
148
|
|
|
149
149
|
// src/constants.ts
|
|
150
150
|
var VERSION = version;
|
|
@@ -1905,7 +1905,7 @@ var startDevPrewarm = ({
|
|
|
1905
1905
|
};
|
|
1906
1906
|
var createAstroLineFilter = () => {
|
|
1907
1907
|
return (line) => {
|
|
1908
|
-
return line.includes("[glob-loader]") ||
|
|
1908
|
+
return line.includes("[glob-loader]") || /^\s*The collection ".*" does not exist or is empty\. Please check your content config file for errors\.\s*$/.test(line);
|
|
1909
1909
|
};
|
|
1910
1910
|
};
|
|
1911
1911
|
var createAstroDevLineFilter = () => {
|
|
@@ -2244,34 +2244,43 @@ program.command("build").description("Run build of EventCatalog").action(async (
|
|
|
2244
2244
|
logger.info(`Indexed ${result.records} page(s) into ${import_node_path11.default.relative(dir, result.outputPath)}`, "search");
|
|
2245
2245
|
}
|
|
2246
2246
|
});
|
|
2247
|
-
var previewCatalog = ({
|
|
2247
|
+
var previewCatalog = async ({
|
|
2248
2248
|
command,
|
|
2249
2249
|
canEmbedPages = false,
|
|
2250
2250
|
isEventCatalogStarter = false,
|
|
2251
2251
|
isEventCatalogScale = false
|
|
2252
2252
|
}) => {
|
|
2253
|
-
|
|
2254
|
-
`
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2253
|
+
await runCommandWithFilteredOutput({
|
|
2254
|
+
command: `npx astro preview ${command.args.join(" ").trim()}`,
|
|
2255
|
+
cwd: core,
|
|
2256
|
+
env: {
|
|
2257
|
+
PROJECT_DIR: dir,
|
|
2258
|
+
CATALOG_DIR: core,
|
|
2259
|
+
ENABLE_EMBED: String(canEmbedPages),
|
|
2260
|
+
EVENTCATALOG_STARTER: String(isEventCatalogStarter),
|
|
2261
|
+
EVENTCATALOG_SCALE: String(isEventCatalogScale)
|
|
2262
|
+
},
|
|
2263
|
+
shouldFilterLine: createAstroLineFilter()
|
|
2264
|
+
});
|
|
2260
2265
|
};
|
|
2261
|
-
var startServerCatalog = ({
|
|
2262
|
-
command,
|
|
2266
|
+
var startServerCatalog = async ({
|
|
2263
2267
|
canEmbedPages = false,
|
|
2264
2268
|
isEventCatalogStarter = false,
|
|
2265
2269
|
isEventCatalogScale = false
|
|
2266
2270
|
}) => {
|
|
2267
2271
|
const serverEntryPath = import_node_path11.default.join(dir, "dist", "server", "entry.mjs");
|
|
2268
|
-
|
|
2269
|
-
`
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2272
|
+
await runCommandWithFilteredOutput({
|
|
2273
|
+
command: `node "${serverEntryPath}"`,
|
|
2274
|
+
cwd: core,
|
|
2275
|
+
env: {
|
|
2276
|
+
PROJECT_DIR: dir,
|
|
2277
|
+
CATALOG_DIR: core,
|
|
2278
|
+
ENABLE_EMBED: String(canEmbedPages),
|
|
2279
|
+
EVENTCATALOG_STARTER: String(isEventCatalogStarter),
|
|
2280
|
+
EVENTCATALOG_SCALE: String(isEventCatalogScale)
|
|
2281
|
+
},
|
|
2282
|
+
shouldFilterLine: createAstroLineFilter()
|
|
2283
|
+
});
|
|
2275
2284
|
};
|
|
2276
2285
|
program.command("preview").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
|
|
2277
2286
|
logger.welcome();
|
|
@@ -2285,7 +2294,12 @@ program.command("preview").description("Serves the contents of your eventcatalog
|
|
|
2285
2294
|
);
|
|
2286
2295
|
const isEventCatalogStarter = await (0, import_license.isEventCatalogStarterEnabled)();
|
|
2287
2296
|
const isEventCatalogScale = await (0, import_license.isEventCatalogScaleEnabled)();
|
|
2288
|
-
previewCatalog({
|
|
2297
|
+
await previewCatalog({
|
|
2298
|
+
command,
|
|
2299
|
+
canEmbedPages: canEmbedPages || isEventCatalogScale,
|
|
2300
|
+
isEventCatalogStarter,
|
|
2301
|
+
isEventCatalogScale
|
|
2302
|
+
});
|
|
2289
2303
|
});
|
|
2290
2304
|
program.command("start").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
|
|
2291
2305
|
logger.welcome();
|
|
@@ -2301,14 +2315,13 @@ program.command("start").description("Serves the contents of your eventcatalog b
|
|
|
2301
2315
|
const isEventCatalogScale = await (0, import_license.isEventCatalogScaleEnabled)();
|
|
2302
2316
|
const isServerOutput = await isOutputServer();
|
|
2303
2317
|
if (isServerOutput) {
|
|
2304
|
-
startServerCatalog({
|
|
2305
|
-
command,
|
|
2318
|
+
await startServerCatalog({
|
|
2306
2319
|
canEmbedPages: canEmbedPages || isEventCatalogScale,
|
|
2307
2320
|
isEventCatalogStarter,
|
|
2308
2321
|
isEventCatalogScale
|
|
2309
2322
|
});
|
|
2310
2323
|
} else {
|
|
2311
|
-
previewCatalog({
|
|
2324
|
+
await previewCatalog({
|
|
2312
2325
|
command,
|
|
2313
2326
|
canEmbedPages: canEmbedPages || isEventCatalogScale,
|
|
2314
2327
|
isEventCatalogStarter,
|
package/dist/eventcatalog.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-V6UMVNX4.js";
|
|
4
4
|
import {
|
|
5
5
|
runMigrations
|
|
6
6
|
} from "./chunk-XUAF2H54.js";
|
|
7
7
|
import "./chunk-CA4U2JP7.js";
|
|
8
8
|
import {
|
|
9
9
|
generate
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-A6SWOPJ4.js";
|
|
11
11
|
import {
|
|
12
12
|
logger
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-DTQ2MXRB.js";
|
|
14
14
|
import {
|
|
15
15
|
resolve_catalog_dependencies_default
|
|
16
16
|
} from "./chunk-LHR4G2UO.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
watch
|
|
22
22
|
} from "./chunk-CAJUIMDJ.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-RQ36O7QA.js";
|
|
24
24
|
import "./chunk-K2XIENVT.js";
|
|
25
25
|
import {
|
|
26
26
|
catalogToAstro
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
import "./chunk-W5JQON7Z.js";
|
|
29
29
|
import {
|
|
30
30
|
VERSION
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-PUTZR6SV.js";
|
|
32
32
|
import {
|
|
33
33
|
linkCoreNodeModules,
|
|
34
34
|
resolveInstalledCoreNodeModules
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
|
|
47
47
|
// src/eventcatalog.ts
|
|
48
48
|
import { Command } from "commander";
|
|
49
|
-
import {
|
|
49
|
+
import { spawn } from "child_process";
|
|
50
50
|
import { join } from "path";
|
|
51
51
|
import http from "http";
|
|
52
52
|
import fs3 from "fs";
|
|
@@ -679,7 +679,7 @@ var startDevPrewarm = ({
|
|
|
679
679
|
};
|
|
680
680
|
var createAstroLineFilter = () => {
|
|
681
681
|
return (line) => {
|
|
682
|
-
return line.includes("[glob-loader]") ||
|
|
682
|
+
return line.includes("[glob-loader]") || /^\s*The collection ".*" does not exist or is empty\. Please check your content config file for errors\.\s*$/.test(line);
|
|
683
683
|
};
|
|
684
684
|
};
|
|
685
685
|
var createAstroDevLineFilter = () => {
|
|
@@ -1018,34 +1018,43 @@ program.command("build").description("Run build of EventCatalog").action(async (
|
|
|
1018
1018
|
logger.info(`Indexed ${result.records} page(s) into ${path2.relative(dir, result.outputPath)}`, "search");
|
|
1019
1019
|
}
|
|
1020
1020
|
});
|
|
1021
|
-
var previewCatalog = ({
|
|
1021
|
+
var previewCatalog = async ({
|
|
1022
1022
|
command,
|
|
1023
1023
|
canEmbedPages = false,
|
|
1024
1024
|
isEventCatalogStarter = false,
|
|
1025
1025
|
isEventCatalogScale = false
|
|
1026
1026
|
}) => {
|
|
1027
|
-
|
|
1028
|
-
`
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1027
|
+
await runCommandWithFilteredOutput({
|
|
1028
|
+
command: `npx astro preview ${command.args.join(" ").trim()}`,
|
|
1029
|
+
cwd: core,
|
|
1030
|
+
env: {
|
|
1031
|
+
PROJECT_DIR: dir,
|
|
1032
|
+
CATALOG_DIR: core,
|
|
1033
|
+
ENABLE_EMBED: String(canEmbedPages),
|
|
1034
|
+
EVENTCATALOG_STARTER: String(isEventCatalogStarter),
|
|
1035
|
+
EVENTCATALOG_SCALE: String(isEventCatalogScale)
|
|
1036
|
+
},
|
|
1037
|
+
shouldFilterLine: createAstroLineFilter()
|
|
1038
|
+
});
|
|
1034
1039
|
};
|
|
1035
|
-
var startServerCatalog = ({
|
|
1036
|
-
command,
|
|
1040
|
+
var startServerCatalog = async ({
|
|
1037
1041
|
canEmbedPages = false,
|
|
1038
1042
|
isEventCatalogStarter = false,
|
|
1039
1043
|
isEventCatalogScale = false
|
|
1040
1044
|
}) => {
|
|
1041
1045
|
const serverEntryPath = path2.join(dir, "dist", "server", "entry.mjs");
|
|
1042
|
-
|
|
1043
|
-
`
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1046
|
+
await runCommandWithFilteredOutput({
|
|
1047
|
+
command: `node "${serverEntryPath}"`,
|
|
1048
|
+
cwd: core,
|
|
1049
|
+
env: {
|
|
1050
|
+
PROJECT_DIR: dir,
|
|
1051
|
+
CATALOG_DIR: core,
|
|
1052
|
+
ENABLE_EMBED: String(canEmbedPages),
|
|
1053
|
+
EVENTCATALOG_STARTER: String(isEventCatalogStarter),
|
|
1054
|
+
EVENTCATALOG_SCALE: String(isEventCatalogScale)
|
|
1055
|
+
},
|
|
1056
|
+
shouldFilterLine: createAstroLineFilter()
|
|
1057
|
+
});
|
|
1049
1058
|
};
|
|
1050
1059
|
program.command("preview").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
|
|
1051
1060
|
logger.welcome();
|
|
@@ -1059,7 +1068,12 @@ program.command("preview").description("Serves the contents of your eventcatalog
|
|
|
1059
1068
|
);
|
|
1060
1069
|
const isEventCatalogStarter = await isEventCatalogStarterEnabled();
|
|
1061
1070
|
const isEventCatalogScale = await isEventCatalogScaleEnabled();
|
|
1062
|
-
previewCatalog({
|
|
1071
|
+
await previewCatalog({
|
|
1072
|
+
command,
|
|
1073
|
+
canEmbedPages: canEmbedPages || isEventCatalogScale,
|
|
1074
|
+
isEventCatalogStarter,
|
|
1075
|
+
isEventCatalogScale
|
|
1076
|
+
});
|
|
1063
1077
|
});
|
|
1064
1078
|
program.command("start").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
|
|
1065
1079
|
logger.welcome();
|
|
@@ -1075,14 +1089,13 @@ program.command("start").description("Serves the contents of your eventcatalog b
|
|
|
1075
1089
|
const isEventCatalogScale = await isEventCatalogScaleEnabled();
|
|
1076
1090
|
const isServerOutput = await isOutputServer();
|
|
1077
1091
|
if (isServerOutput) {
|
|
1078
|
-
startServerCatalog({
|
|
1079
|
-
command,
|
|
1092
|
+
await startServerCatalog({
|
|
1080
1093
|
canEmbedPages: canEmbedPages || isEventCatalogScale,
|
|
1081
1094
|
isEventCatalogStarter,
|
|
1082
1095
|
isEventCatalogScale
|
|
1083
1096
|
});
|
|
1084
1097
|
} else {
|
|
1085
|
-
previewCatalog({
|
|
1098
|
+
await previewCatalog({
|
|
1086
1099
|
command,
|
|
1087
1100
|
canEmbedPages: canEmbedPages || isEventCatalogScale,
|
|
1088
1101
|
isEventCatalogStarter,
|
package/dist/generate.cjs
CHANGED
|
@@ -108,7 +108,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
|
108
108
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
109
109
|
|
|
110
110
|
// package.json
|
|
111
|
-
var version = "4.2.
|
|
111
|
+
var version = "4.2.1";
|
|
112
112
|
|
|
113
113
|
// src/constants.ts
|
|
114
114
|
var VERSION = version;
|
package/dist/generate.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generate
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-A6SWOPJ4.js";
|
|
4
|
+
import "./chunk-DTQ2MXRB.js";
|
|
5
|
+
import "./chunk-PUTZR6SV.js";
|
|
6
6
|
import "./chunk-6QENHZZP.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -9,6 +9,7 @@ import config from '@config';
|
|
|
9
9
|
import fs from 'fs';
|
|
10
10
|
import { isLLMSTxtEnabled } from '@utils/feature';
|
|
11
11
|
import { filterMarkdownForAgents } from '@utils/llms';
|
|
12
|
+
import { getAbsoluteFilePathForAstroFile } from '@utils/files';
|
|
12
13
|
|
|
13
14
|
const events = await getCollection('events');
|
|
14
15
|
const agents = await getCollection('agents');
|
|
@@ -67,7 +68,8 @@ export const GET: APIRoute = async ({ params, props }) => {
|
|
|
67
68
|
|
|
68
69
|
const content = props?.content ?? findContent(params);
|
|
69
70
|
if (content?.filePath) {
|
|
70
|
-
const
|
|
71
|
+
const absoluteFilePath = getAbsoluteFilePathForAstroFile(content.filePath);
|
|
72
|
+
const file = filterMarkdownForAgents(fs.readFileSync(absoluteFilePath, 'utf8'));
|
|
71
73
|
return new Response(file, { status: 200 });
|
|
72
74
|
}
|
|
73
75
|
|
|
@@ -8,6 +8,7 @@ import config from '@config';
|
|
|
8
8
|
import fs from 'fs';
|
|
9
9
|
import { addSchemaToMarkdown, filterMarkdownForAgents } from '@utils/llms';
|
|
10
10
|
import { isLLMSTxtEnabled, isSSR } from '@utils/feature';
|
|
11
|
+
import { getAbsoluteFilePathForAstroFile } from '@utils/files';
|
|
11
12
|
const events = await getCollection('events');
|
|
12
13
|
const agents = await getCollection('agents');
|
|
13
14
|
const commands = await getCollection('commands');
|
|
@@ -67,10 +68,11 @@ export const GET: APIRoute = async ({ params, props }) => {
|
|
|
67
68
|
|
|
68
69
|
const content = props?.content ?? findContent(params);
|
|
69
70
|
if (content?.filePath) {
|
|
70
|
-
|
|
71
|
+
const absoluteFilePath = getAbsoluteFilePathForAstroFile(content.filePath);
|
|
72
|
+
let file = fs.readFileSync(absoluteFilePath, 'utf8');
|
|
71
73
|
|
|
72
74
|
try {
|
|
73
|
-
file = addSchemaToMarkdown(content, file);
|
|
75
|
+
file = addSchemaToMarkdown({ ...content, filePath: absoluteFilePath }, file);
|
|
74
76
|
} catch (error) {
|
|
75
77
|
console.log('Warning: Cant find the schema for', content.data.id, content.data.version);
|
|
76
78
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { readdir, readFile } from 'node:fs/promises';
|
|
2
|
-
import { dirname, join } from 'node:path';
|
|
2
|
+
import { dirname, isAbsolute, join } from 'node:path';
|
|
3
3
|
import { formatPatch, structuredPatch } from 'diff';
|
|
4
4
|
import { html, parse } from 'diff2html';
|
|
5
5
|
import { getItemsFromCollectionByIdAndSemverOrLatest } from './collections/util';
|
|
6
|
+
import { getAbsoluteFilePathForAstroFile } from './files';
|
|
6
7
|
import type { CollectionEntry } from 'astro:content';
|
|
7
8
|
import type { CollectionTypes } from '@types';
|
|
8
9
|
|
|
@@ -32,7 +33,8 @@ export async function getFilesForDiffInCollection(
|
|
|
32
33
|
const pathToFolder = collection.filePath;
|
|
33
34
|
if (!pathToFolder) return [];
|
|
34
35
|
|
|
35
|
-
const
|
|
36
|
+
const absolutePathToFolder = isAbsolute(pathToFolder) ? pathToFolder : getAbsoluteFilePathForAstroFile(pathToFolder);
|
|
37
|
+
const dir = dirname(absolutePathToFolder);
|
|
36
38
|
const allFilesInDirectory = await readdir(dir);
|
|
37
39
|
|
|
38
40
|
return allFilesInDirectory
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"license": "SEE LICENSE IN LICENSE",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"version": "4.2.
|
|
10
|
+
"version": "4.2.1",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
@@ -116,9 +116,9 @@
|
|
|
116
116
|
"update-notifier": "^7.3.1",
|
|
117
117
|
"uuid": "^10.0.0",
|
|
118
118
|
"zod": "^4.3.6",
|
|
119
|
-
"@eventcatalog/linter": "1.1.5",
|
|
120
119
|
"@eventcatalog/sdk": "2.26.0",
|
|
121
|
-
"@eventcatalog/visualiser": "^4.1.0"
|
|
120
|
+
"@eventcatalog/visualiser": "^4.1.0",
|
|
121
|
+
"@eventcatalog/linter": "1.1.5"
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
124
|
"@astrojs/check": "^0.9.9",
|