@eventcatalog/core 3.43.1 → 3.44.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/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +50 -2
- package/dist/analytics/log-build.js +4 -4
- package/dist/catalog-to-astro-content-directory.cjs +31 -1
- package/dist/catalog-to-astro-content-directory.js +2 -2
- package/dist/{chunk-O6KT4DPL.js → chunk-4SMA4HQ3.js} +1 -1
- package/dist/{chunk-5T63CXKU.js → chunk-6QENHZZP.js} +32 -2
- package/dist/{chunk-2GQO7I7E.js → chunk-A7WJATRV.js} +2 -2
- package/dist/{chunk-ULZYHF3V.js → chunk-B7HCX5HM.js} +1 -1
- package/dist/{chunk-C6S5P57F.js → chunk-H7IGB2WO.js} +1 -1
- package/dist/{chunk-Z5QHV4ZY.js → chunk-L2JZBH6K.js} +1 -1
- package/dist/{chunk-WAJIJEI3.js → chunk-LHR4G2UO.js} +1 -1
- package/dist/{chunk-OOX6HAE4.js → chunk-SWSSBJ6H.js} +20 -2
- package/dist/{chunk-KV5FCOV4.js → chunk-W7UIDHNR.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog-config-file-utils.cjs +31 -1
- package/dist/eventcatalog-config-file-utils.js +1 -1
- package/dist/eventcatalog.cjs +50 -2
- package/dist/eventcatalog.config.d.cts +25 -0
- package/dist/eventcatalog.config.d.ts +25 -0
- package/dist/eventcatalog.js +9 -9
- package/dist/features.cjs +31 -1
- package/dist/features.js +2 -2
- package/dist/generate.cjs +32 -2
- package/dist/generate.js +4 -4
- package/dist/resolve-catalog-dependencies.cjs +31 -1
- package/dist/resolve-catalog-dependencies.js +2 -2
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/astro.config.mjs +9 -1
- package/eventcatalog/src/components/FieldsExplorer/FieldNodeGraph.tsx +2 -2
- package/eventcatalog/src/components/Tables/Table.tsx +4 -0
- package/eventcatalog/src/components/Tables/columns/DirectorySourceColumn.tsx +49 -0
- package/eventcatalog/src/components/Tables/columns/TeamsTableColumns.tsx +11 -0
- package/eventcatalog/src/components/Tables/columns/UserTableColumns.tsx +11 -0
- package/eventcatalog/src/content.config.ts +29 -8
- package/eventcatalog/src/enterprise/directory/user-team-directory.spec.ts +527 -0
- package/eventcatalog/src/enterprise/directory/user-team-directory.ts +191 -0
- package/eventcatalog/src/pages/directory/[type]/index.astro +2 -0
- package/eventcatalog/src/pages/docs/teams/[id]/index.astro +29 -5
- package/eventcatalog/src/pages/docs/users/[id]/index.astro +29 -0
- package/eventcatalog/src/stores/eventcatalog-store.spec.ts +60 -0
- package/eventcatalog/src/stores/eventcatalog-store.ts +103 -0
- package/package.json +3 -3
|
@@ -48,6 +48,36 @@ async function cleanup(projectDirectory) {
|
|
|
48
48
|
await (0, import_promises.rm)(filePath);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
+
var findNodeModulesDirectory = (directory) => {
|
|
52
|
+
let currentDirectory = directory;
|
|
53
|
+
while (true) {
|
|
54
|
+
const nodeModulesDirectory = import_node_path.default.join(currentDirectory, "node_modules");
|
|
55
|
+
if ((0, import_node_fs.existsSync)(nodeModulesDirectory)) {
|
|
56
|
+
return nodeModulesDirectory;
|
|
57
|
+
}
|
|
58
|
+
const parentDirectory = import_node_path.default.dirname(currentDirectory);
|
|
59
|
+
if (parentDirectory === currentDirectory) {
|
|
60
|
+
return void 0;
|
|
61
|
+
}
|
|
62
|
+
currentDirectory = parentDirectory;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var linkNodeModulesIntoTempDirectory = async ({ projectDirectory, tempDir }) => {
|
|
66
|
+
const nodeModulesDirectory = findNodeModulesDirectory(projectDirectory);
|
|
67
|
+
if (!nodeModulesDirectory) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
await (0, import_promises.symlink)(nodeModulesDirectory, import_node_path.default.join(tempDir, "node_modules"), "dir");
|
|
71
|
+
};
|
|
72
|
+
var createTemporaryConfigDirectory = async (projectDirectory) => {
|
|
73
|
+
const nodeModulesDirectory = findNodeModulesDirectory(projectDirectory);
|
|
74
|
+
if (nodeModulesDirectory) {
|
|
75
|
+
return (0, import_promises.mkdtemp)(import_node_path.default.join(nodeModulesDirectory, ".eventcatalog-config-"));
|
|
76
|
+
}
|
|
77
|
+
const tempDir = await (0, import_promises.mkdtemp)(import_node_path.default.join((0, import_node_os.tmpdir)(), "eventcatalog-config-"));
|
|
78
|
+
await linkNodeModulesIntoTempDirectory({ projectDirectory, tempDir });
|
|
79
|
+
return tempDir;
|
|
80
|
+
};
|
|
51
81
|
var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
52
82
|
let tempDir;
|
|
53
83
|
try {
|
|
@@ -55,7 +85,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
|
55
85
|
const filePath = import_node_path.default.join(projectDirectory, "package.json");
|
|
56
86
|
const packageJson = JSON.parse(await (0, import_promises.readFile)(filePath, "utf-8"));
|
|
57
87
|
if (packageJson?.type !== "module") {
|
|
58
|
-
tempDir = await (
|
|
88
|
+
tempDir = await createTemporaryConfigDirectory(projectDirectory);
|
|
59
89
|
configFilePath = import_node_path.default.join(tempDir, "eventcatalog.config.mjs");
|
|
60
90
|
await (0, import_promises.copyFile)(import_node_path.default.join(projectDirectory, "eventcatalog.config.js"), configFilePath);
|
|
61
91
|
}
|
|
@@ -110,7 +140,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
110
140
|
var import_os = __toESM(require("os"), 1);
|
|
111
141
|
|
|
112
142
|
// package.json
|
|
113
|
-
var version = "3.
|
|
143
|
+
var version = "3.44.0";
|
|
114
144
|
|
|
115
145
|
// src/constants.ts
|
|
116
146
|
var VERSION = version;
|
|
@@ -195,6 +225,23 @@ var getFeatures = async (configFile) => {
|
|
|
195
225
|
output: configFile.output || "static"
|
|
196
226
|
};
|
|
197
227
|
};
|
|
228
|
+
var getDirectoryProvider = (source) => {
|
|
229
|
+
if (!source?.name || typeof source.name !== "string") return "unknown";
|
|
230
|
+
return source.name.split(":")[0] || "unknown";
|
|
231
|
+
};
|
|
232
|
+
var serializeDirectorySources = (configFile) => {
|
|
233
|
+
const sources = configFile.directory?.sources;
|
|
234
|
+
if (!Array.isArray(sources) || sources.length === 0) return "none";
|
|
235
|
+
const providerCounts = sources.reduce((counts, source) => {
|
|
236
|
+
const provider = getDirectoryProvider(source);
|
|
237
|
+
counts[provider] = (counts[provider] || 0) + 1;
|
|
238
|
+
return counts;
|
|
239
|
+
}, {});
|
|
240
|
+
const providers = Object.keys(providerCounts).sort().map((provider) => `${provider}:${providerCounts[provider]}`).join(",");
|
|
241
|
+
const hasUsers = sources.some((source) => typeof source?.loadUsers === "function");
|
|
242
|
+
const hasTeams = sources.some((source) => typeof source?.loadTeams === "function");
|
|
243
|
+
return `sources:${sources.length},providers:${providers},users:${hasUsers},teams:${hasTeams}`;
|
|
244
|
+
};
|
|
198
245
|
var CLOUD_ANALYTICS_ENDPOINT = "https://api.ecingest.dev/v1/analytics/ingest";
|
|
199
246
|
var toCloudResourceCounts = (counts) => ({
|
|
200
247
|
adrs: counts.adrs || 0,
|
|
@@ -257,6 +304,7 @@ var main = async (projectDir, { isEventCatalogStarterEnabled, isEventCatalogScal
|
|
|
257
304
|
cId,
|
|
258
305
|
generators: generatorNames.toString(),
|
|
259
306
|
features: Object.keys(features).map((feature) => `${feature}:${features[feature]}`).join(","),
|
|
307
|
+
directorySources: serializeDirectorySources(configFile),
|
|
260
308
|
resources: serializeCounts(resourceCounts)
|
|
261
309
|
});
|
|
262
310
|
} catch (error) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-SWSSBJ6H.js";
|
|
4
|
+
import "../chunk-H7IGB2WO.js";
|
|
5
5
|
import "../chunk-DAOXTQVS.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-W7UIDHNR.js";
|
|
7
|
+
import "../chunk-6QENHZZP.js";
|
|
8
8
|
export {
|
|
9
9
|
log_build_default as default
|
|
10
10
|
};
|
|
@@ -59,6 +59,36 @@ async function cleanup(projectDirectory) {
|
|
|
59
59
|
await (0, import_promises.rm)(filePath);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
+
var findNodeModulesDirectory = (directory) => {
|
|
63
|
+
let currentDirectory = directory;
|
|
64
|
+
while (true) {
|
|
65
|
+
const nodeModulesDirectory = import_node_path.default.join(currentDirectory, "node_modules");
|
|
66
|
+
if ((0, import_node_fs.existsSync)(nodeModulesDirectory)) {
|
|
67
|
+
return nodeModulesDirectory;
|
|
68
|
+
}
|
|
69
|
+
const parentDirectory = import_node_path.default.dirname(currentDirectory);
|
|
70
|
+
if (parentDirectory === currentDirectory) {
|
|
71
|
+
return void 0;
|
|
72
|
+
}
|
|
73
|
+
currentDirectory = parentDirectory;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
var linkNodeModulesIntoTempDirectory = async ({ projectDirectory, tempDir }) => {
|
|
77
|
+
const nodeModulesDirectory = findNodeModulesDirectory(projectDirectory);
|
|
78
|
+
if (!nodeModulesDirectory) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
await (0, import_promises.symlink)(nodeModulesDirectory, import_node_path.default.join(tempDir, "node_modules"), "dir");
|
|
82
|
+
};
|
|
83
|
+
var createTemporaryConfigDirectory = async (projectDirectory) => {
|
|
84
|
+
const nodeModulesDirectory = findNodeModulesDirectory(projectDirectory);
|
|
85
|
+
if (nodeModulesDirectory) {
|
|
86
|
+
return (0, import_promises.mkdtemp)(import_node_path.default.join(nodeModulesDirectory, ".eventcatalog-config-"));
|
|
87
|
+
}
|
|
88
|
+
const tempDir = await (0, import_promises.mkdtemp)(import_node_path.default.join((0, import_node_os.tmpdir)(), "eventcatalog-config-"));
|
|
89
|
+
await linkNodeModulesIntoTempDirectory({ projectDirectory, tempDir });
|
|
90
|
+
return tempDir;
|
|
91
|
+
};
|
|
62
92
|
var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
63
93
|
let tempDir;
|
|
64
94
|
try {
|
|
@@ -66,7 +96,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
|
66
96
|
const filePath = import_node_path.default.join(projectDirectory, "package.json");
|
|
67
97
|
const packageJson = JSON.parse(await (0, import_promises.readFile)(filePath, "utf-8"));
|
|
68
98
|
if (packageJson?.type !== "module") {
|
|
69
|
-
tempDir = await (
|
|
99
|
+
tempDir = await createTemporaryConfigDirectory(projectDirectory);
|
|
70
100
|
configFilePath = import_node_path.default.join(tempDir, "eventcatalog.config.mjs");
|
|
71
101
|
await (0, import_promises.copyFile)(import_node_path.default.join(projectDirectory, "eventcatalog.config.js"), configFilePath);
|
|
72
102
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/eventcatalog-config-file-utils.js
|
|
2
|
-
import { readFile, writeFile, rm, copyFile, mkdtemp } from "fs/promises";
|
|
2
|
+
import { readFile, writeFile, rm, copyFile, mkdtemp, symlink } from "fs/promises";
|
|
3
3
|
import { existsSync } from "fs";
|
|
4
4
|
import path from "path";
|
|
5
5
|
import { v4 as uuidV4 } from "uuid";
|
|
@@ -12,6 +12,36 @@ async function cleanup(projectDirectory) {
|
|
|
12
12
|
await rm(filePath);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
+
var findNodeModulesDirectory = (directory) => {
|
|
16
|
+
let currentDirectory = directory;
|
|
17
|
+
while (true) {
|
|
18
|
+
const nodeModulesDirectory = path.join(currentDirectory, "node_modules");
|
|
19
|
+
if (existsSync(nodeModulesDirectory)) {
|
|
20
|
+
return nodeModulesDirectory;
|
|
21
|
+
}
|
|
22
|
+
const parentDirectory = path.dirname(currentDirectory);
|
|
23
|
+
if (parentDirectory === currentDirectory) {
|
|
24
|
+
return void 0;
|
|
25
|
+
}
|
|
26
|
+
currentDirectory = parentDirectory;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var linkNodeModulesIntoTempDirectory = async ({ projectDirectory, tempDir }) => {
|
|
30
|
+
const nodeModulesDirectory = findNodeModulesDirectory(projectDirectory);
|
|
31
|
+
if (!nodeModulesDirectory) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
await symlink(nodeModulesDirectory, path.join(tempDir, "node_modules"), "dir");
|
|
35
|
+
};
|
|
36
|
+
var createTemporaryConfigDirectory = async (projectDirectory) => {
|
|
37
|
+
const nodeModulesDirectory = findNodeModulesDirectory(projectDirectory);
|
|
38
|
+
if (nodeModulesDirectory) {
|
|
39
|
+
return mkdtemp(path.join(nodeModulesDirectory, ".eventcatalog-config-"));
|
|
40
|
+
}
|
|
41
|
+
const tempDir = await mkdtemp(path.join(tmpdir(), "eventcatalog-config-"));
|
|
42
|
+
await linkNodeModulesIntoTempDirectory({ projectDirectory, tempDir });
|
|
43
|
+
return tempDir;
|
|
44
|
+
};
|
|
15
45
|
var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
16
46
|
let tempDir;
|
|
17
47
|
try {
|
|
@@ -19,7 +49,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
|
19
49
|
const filePath = path.join(projectDirectory, "package.json");
|
|
20
50
|
const packageJson = JSON.parse(await readFile(filePath, "utf-8"));
|
|
21
51
|
if (packageJson?.type !== "module") {
|
|
22
|
-
tempDir = await
|
|
52
|
+
tempDir = await createTemporaryConfigDirectory(projectDirectory);
|
|
23
53
|
configFilePath = path.join(tempDir, "eventcatalog.config.mjs");
|
|
24
54
|
await copyFile(path.join(projectDirectory, "eventcatalog.config.js"), configFilePath);
|
|
25
55
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
raiseEvent
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-H7IGB2WO.js";
|
|
4
4
|
import {
|
|
5
5
|
countResources,
|
|
6
6
|
serializeCounts
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
getEventCatalogConfigFile,
|
|
10
10
|
verifyRequiredFieldsAreInCatalogConfigFile
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6QENHZZP.js";
|
|
12
12
|
|
|
13
13
|
// src/analytics/log-build.js
|
|
14
14
|
var getFeatures = async (configFile) => {
|
|
@@ -19,6 +19,23 @@ var getFeatures = async (configFile) => {
|
|
|
19
19
|
output: configFile.output || "static"
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
+
var getDirectoryProvider = (source) => {
|
|
23
|
+
if (!source?.name || typeof source.name !== "string") return "unknown";
|
|
24
|
+
return source.name.split(":")[0] || "unknown";
|
|
25
|
+
};
|
|
26
|
+
var serializeDirectorySources = (configFile) => {
|
|
27
|
+
const sources = configFile.directory?.sources;
|
|
28
|
+
if (!Array.isArray(sources) || sources.length === 0) return "none";
|
|
29
|
+
const providerCounts = sources.reduce((counts, source) => {
|
|
30
|
+
const provider = getDirectoryProvider(source);
|
|
31
|
+
counts[provider] = (counts[provider] || 0) + 1;
|
|
32
|
+
return counts;
|
|
33
|
+
}, {});
|
|
34
|
+
const providers = Object.keys(providerCounts).sort().map((provider) => `${provider}:${providerCounts[provider]}`).join(",");
|
|
35
|
+
const hasUsers = sources.some((source) => typeof source?.loadUsers === "function");
|
|
36
|
+
const hasTeams = sources.some((source) => typeof source?.loadTeams === "function");
|
|
37
|
+
return `sources:${sources.length},providers:${providers},users:${hasUsers},teams:${hasTeams}`;
|
|
38
|
+
};
|
|
22
39
|
var CLOUD_ANALYTICS_ENDPOINT = "https://api.ecingest.dev/v1/analytics/ingest";
|
|
23
40
|
var toCloudResourceCounts = (counts) => ({
|
|
24
41
|
adrs: counts.adrs || 0,
|
|
@@ -81,6 +98,7 @@ var main = async (projectDir, { isEventCatalogStarterEnabled, isEventCatalogScal
|
|
|
81
98
|
cId,
|
|
82
99
|
generators: generatorNames.toString(),
|
|
83
100
|
features: Object.keys(features).map((feature) => `${feature}:${features[feature]}`).join(","),
|
|
101
|
+
directorySources: serializeDirectorySources(configFile),
|
|
84
102
|
resources: serializeCounts(resourceCounts)
|
|
85
103
|
});
|
|
86
104
|
} catch (error) {
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
|
@@ -50,6 +50,36 @@ async function cleanup(projectDirectory) {
|
|
|
50
50
|
await (0, import_promises.rm)(filePath);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
+
var findNodeModulesDirectory = (directory) => {
|
|
54
|
+
let currentDirectory = directory;
|
|
55
|
+
while (true) {
|
|
56
|
+
const nodeModulesDirectory = import_node_path.default.join(currentDirectory, "node_modules");
|
|
57
|
+
if ((0, import_node_fs.existsSync)(nodeModulesDirectory)) {
|
|
58
|
+
return nodeModulesDirectory;
|
|
59
|
+
}
|
|
60
|
+
const parentDirectory = import_node_path.default.dirname(currentDirectory);
|
|
61
|
+
if (parentDirectory === currentDirectory) {
|
|
62
|
+
return void 0;
|
|
63
|
+
}
|
|
64
|
+
currentDirectory = parentDirectory;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
var linkNodeModulesIntoTempDirectory = async ({ projectDirectory, tempDir }) => {
|
|
68
|
+
const nodeModulesDirectory = findNodeModulesDirectory(projectDirectory);
|
|
69
|
+
if (!nodeModulesDirectory) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
await (0, import_promises.symlink)(nodeModulesDirectory, import_node_path.default.join(tempDir, "node_modules"), "dir");
|
|
73
|
+
};
|
|
74
|
+
var createTemporaryConfigDirectory = async (projectDirectory) => {
|
|
75
|
+
const nodeModulesDirectory = findNodeModulesDirectory(projectDirectory);
|
|
76
|
+
if (nodeModulesDirectory) {
|
|
77
|
+
return (0, import_promises.mkdtemp)(import_node_path.default.join(nodeModulesDirectory, ".eventcatalog-config-"));
|
|
78
|
+
}
|
|
79
|
+
const tempDir = await (0, import_promises.mkdtemp)(import_node_path.default.join((0, import_node_os.tmpdir)(), "eventcatalog-config-"));
|
|
80
|
+
await linkNodeModulesIntoTempDirectory({ projectDirectory, tempDir });
|
|
81
|
+
return tempDir;
|
|
82
|
+
};
|
|
53
83
|
var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
54
84
|
let tempDir;
|
|
55
85
|
try {
|
|
@@ -57,7 +87,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
|
57
87
|
const filePath = import_node_path.default.join(projectDirectory, "package.json");
|
|
58
88
|
const packageJson = JSON.parse(await (0, import_promises.readFile)(filePath, "utf-8"));
|
|
59
89
|
if (packageJson?.type !== "module") {
|
|
60
|
-
tempDir = await (
|
|
90
|
+
tempDir = await createTemporaryConfigDirectory(projectDirectory);
|
|
61
91
|
configFilePath = import_node_path.default.join(tempDir, "eventcatalog.config.mjs");
|
|
62
92
|
await (0, import_promises.copyFile)(import_node_path.default.join(projectDirectory, "eventcatalog.config.js"), configFilePath);
|
|
63
93
|
}
|
package/dist/eventcatalog.cjs
CHANGED
|
@@ -52,6 +52,36 @@ async function cleanup(projectDirectory) {
|
|
|
52
52
|
await (0, import_promises.rm)(filePath);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
+
var findNodeModulesDirectory = (directory) => {
|
|
56
|
+
let currentDirectory = directory;
|
|
57
|
+
while (true) {
|
|
58
|
+
const nodeModulesDirectory = import_node_path.default.join(currentDirectory, "node_modules");
|
|
59
|
+
if ((0, import_node_fs.existsSync)(nodeModulesDirectory)) {
|
|
60
|
+
return nodeModulesDirectory;
|
|
61
|
+
}
|
|
62
|
+
const parentDirectory = import_node_path.default.dirname(currentDirectory);
|
|
63
|
+
if (parentDirectory === currentDirectory) {
|
|
64
|
+
return void 0;
|
|
65
|
+
}
|
|
66
|
+
currentDirectory = parentDirectory;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
var linkNodeModulesIntoTempDirectory = async ({ projectDirectory, tempDir }) => {
|
|
70
|
+
const nodeModulesDirectory = findNodeModulesDirectory(projectDirectory);
|
|
71
|
+
if (!nodeModulesDirectory) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
await (0, import_promises.symlink)(nodeModulesDirectory, import_node_path.default.join(tempDir, "node_modules"), "dir");
|
|
75
|
+
};
|
|
76
|
+
var createTemporaryConfigDirectory = async (projectDirectory) => {
|
|
77
|
+
const nodeModulesDirectory = findNodeModulesDirectory(projectDirectory);
|
|
78
|
+
if (nodeModulesDirectory) {
|
|
79
|
+
return (0, import_promises.mkdtemp)(import_node_path.default.join(nodeModulesDirectory, ".eventcatalog-config-"));
|
|
80
|
+
}
|
|
81
|
+
const tempDir = await (0, import_promises.mkdtemp)(import_node_path.default.join((0, import_node_os.tmpdir)(), "eventcatalog-config-"));
|
|
82
|
+
await linkNodeModulesIntoTempDirectory({ projectDirectory, tempDir });
|
|
83
|
+
return tempDir;
|
|
84
|
+
};
|
|
55
85
|
var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
56
86
|
let tempDir;
|
|
57
87
|
try {
|
|
@@ -59,7 +89,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
|
59
89
|
const filePath = import_node_path.default.join(projectDirectory, "package.json");
|
|
60
90
|
const packageJson = JSON.parse(await (0, import_promises.readFile)(filePath, "utf-8"));
|
|
61
91
|
if (packageJson?.type !== "module") {
|
|
62
|
-
tempDir = await (
|
|
92
|
+
tempDir = await createTemporaryConfigDirectory(projectDirectory);
|
|
63
93
|
configFilePath = import_node_path.default.join(tempDir, "eventcatalog.config.mjs");
|
|
64
94
|
await (0, import_promises.copyFile)(import_node_path.default.join(projectDirectory, "eventcatalog.config.js"), configFilePath);
|
|
65
95
|
}
|
|
@@ -114,7 +144,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
114
144
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
115
145
|
|
|
116
146
|
// package.json
|
|
117
|
-
var version = "3.
|
|
147
|
+
var version = "3.44.0";
|
|
118
148
|
|
|
119
149
|
// src/constants.ts
|
|
120
150
|
var VERSION = version;
|
|
@@ -290,6 +320,23 @@ var getFeatures = async (configFile) => {
|
|
|
290
320
|
output: configFile.output || "static"
|
|
291
321
|
};
|
|
292
322
|
};
|
|
323
|
+
var getDirectoryProvider = (source) => {
|
|
324
|
+
if (!source?.name || typeof source.name !== "string") return "unknown";
|
|
325
|
+
return source.name.split(":")[0] || "unknown";
|
|
326
|
+
};
|
|
327
|
+
var serializeDirectorySources = (configFile) => {
|
|
328
|
+
const sources = configFile.directory?.sources;
|
|
329
|
+
if (!Array.isArray(sources) || sources.length === 0) return "none";
|
|
330
|
+
const providerCounts = sources.reduce((counts, source) => {
|
|
331
|
+
const provider = getDirectoryProvider(source);
|
|
332
|
+
counts[provider] = (counts[provider] || 0) + 1;
|
|
333
|
+
return counts;
|
|
334
|
+
}, {});
|
|
335
|
+
const providers = Object.keys(providerCounts).sort().map((provider) => `${provider}:${providerCounts[provider]}`).join(",");
|
|
336
|
+
const hasUsers = sources.some((source) => typeof source?.loadUsers === "function");
|
|
337
|
+
const hasTeams = sources.some((source) => typeof source?.loadTeams === "function");
|
|
338
|
+
return `sources:${sources.length},providers:${providers},users:${hasUsers},teams:${hasTeams}`;
|
|
339
|
+
};
|
|
293
340
|
var CLOUD_ANALYTICS_ENDPOINT = "https://api.ecingest.dev/v1/analytics/ingest";
|
|
294
341
|
var toCloudResourceCounts = (counts) => ({
|
|
295
342
|
adrs: counts.adrs || 0,
|
|
@@ -352,6 +399,7 @@ var main = async (projectDir, { isEventCatalogStarterEnabled: isEventCatalogStar
|
|
|
352
399
|
cId,
|
|
353
400
|
generators: generatorNames.toString(),
|
|
354
401
|
features: Object.keys(features).map((feature) => `${feature}:${features[feature]}`).join(","),
|
|
402
|
+
directorySources: serializeDirectorySources(configFile),
|
|
355
403
|
resources: serializeCounts(resourceCounts)
|
|
356
404
|
});
|
|
357
405
|
} catch (error) {
|
|
@@ -47,6 +47,30 @@ type PagesConfiguration = {
|
|
|
47
47
|
};
|
|
48
48
|
type NavigationPage = string | PagesConfiguration;
|
|
49
49
|
type GeneratorConfig = string | Record<string, unknown> | [string, Record<string, unknown>];
|
|
50
|
+
type DirectoryEntry = {
|
|
51
|
+
id: string;
|
|
52
|
+
markdown?: string;
|
|
53
|
+
[key: string]: unknown;
|
|
54
|
+
};
|
|
55
|
+
type DirectorySource = {
|
|
56
|
+
type: 'directory';
|
|
57
|
+
name: string;
|
|
58
|
+
loadUsers?: () => Promise<DirectoryEntry[]>;
|
|
59
|
+
loadTeams?: () => Promise<DirectoryEntry[]>;
|
|
60
|
+
};
|
|
61
|
+
type DirectoryConfig = {
|
|
62
|
+
/**
|
|
63
|
+
* External sources that sync users and teams into EventCatalog.
|
|
64
|
+
* Requires EventCatalog Scale.
|
|
65
|
+
*/
|
|
66
|
+
sources?: DirectorySource[];
|
|
67
|
+
/**
|
|
68
|
+
* Controls what happens when a local Markdown user/team and an external source
|
|
69
|
+
* return the same id.
|
|
70
|
+
* @default 'local-wins'
|
|
71
|
+
*/
|
|
72
|
+
conflictStrategy?: 'local-wins' | 'source-wins' | 'error';
|
|
73
|
+
};
|
|
50
74
|
type AuthConfig = {
|
|
51
75
|
enabled: boolean;
|
|
52
76
|
};
|
|
@@ -196,6 +220,7 @@ interface Config {
|
|
|
196
220
|
services?: ResourceDependency[];
|
|
197
221
|
domains?: ResourceDependency[];
|
|
198
222
|
};
|
|
223
|
+
directory?: DirectoryConfig;
|
|
199
224
|
mermaid?: {
|
|
200
225
|
maxTextSize?: number;
|
|
201
226
|
iconPacks?: string[];
|
|
@@ -47,6 +47,30 @@ type PagesConfiguration = {
|
|
|
47
47
|
};
|
|
48
48
|
type NavigationPage = string | PagesConfiguration;
|
|
49
49
|
type GeneratorConfig = string | Record<string, unknown> | [string, Record<string, unknown>];
|
|
50
|
+
type DirectoryEntry = {
|
|
51
|
+
id: string;
|
|
52
|
+
markdown?: string;
|
|
53
|
+
[key: string]: unknown;
|
|
54
|
+
};
|
|
55
|
+
type DirectorySource = {
|
|
56
|
+
type: 'directory';
|
|
57
|
+
name: string;
|
|
58
|
+
loadUsers?: () => Promise<DirectoryEntry[]>;
|
|
59
|
+
loadTeams?: () => Promise<DirectoryEntry[]>;
|
|
60
|
+
};
|
|
61
|
+
type DirectoryConfig = {
|
|
62
|
+
/**
|
|
63
|
+
* External sources that sync users and teams into EventCatalog.
|
|
64
|
+
* Requires EventCatalog Scale.
|
|
65
|
+
*/
|
|
66
|
+
sources?: DirectorySource[];
|
|
67
|
+
/**
|
|
68
|
+
* Controls what happens when a local Markdown user/team and an external source
|
|
69
|
+
* return the same id.
|
|
70
|
+
* @default 'local-wins'
|
|
71
|
+
*/
|
|
72
|
+
conflictStrategy?: 'local-wins' | 'source-wins' | 'error';
|
|
73
|
+
};
|
|
50
74
|
type AuthConfig = {
|
|
51
75
|
enabled: boolean;
|
|
52
76
|
};
|
|
@@ -196,6 +220,7 @@ interface Config {
|
|
|
196
220
|
services?: ResourceDependency[];
|
|
197
221
|
domains?: ResourceDependency[];
|
|
198
222
|
};
|
|
223
|
+
directory?: DirectoryConfig;
|
|
199
224
|
mermaid?: {
|
|
200
225
|
maxTextSize?: number;
|
|
201
226
|
iconPacks?: string[];
|
package/dist/eventcatalog.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import "./chunk-CA4U2JP7.js";
|
|
5
5
|
import {
|
|
6
6
|
resolve_catalog_dependencies_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-LHR4G2UO.js";
|
|
8
8
|
import {
|
|
9
9
|
buildSearchIndex
|
|
10
10
|
} from "./chunk-ZONBICNH.js";
|
|
@@ -13,32 +13,32 @@ import {
|
|
|
13
13
|
} from "./chunk-3H2RT3CM.js";
|
|
14
14
|
import {
|
|
15
15
|
log_build_default
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-SWSSBJ6H.js";
|
|
17
|
+
import "./chunk-H7IGB2WO.js";
|
|
18
18
|
import "./chunk-DAOXTQVS.js";
|
|
19
19
|
import {
|
|
20
20
|
catalogToAstro
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-4SMA4HQ3.js";
|
|
22
22
|
import "./chunk-IR4IAKWS.js";
|
|
23
23
|
import {
|
|
24
24
|
getProjectOutDir,
|
|
25
25
|
isAuthEnabled,
|
|
26
26
|
isIndexedSearchEnabled,
|
|
27
27
|
isOutputServer
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-B7HCX5HM.js";
|
|
29
29
|
import {
|
|
30
30
|
generate
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-A7WJATRV.js";
|
|
32
32
|
import {
|
|
33
33
|
logger
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-L2JZBH6K.js";
|
|
35
35
|
import {
|
|
36
36
|
VERSION
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-W7UIDHNR.js";
|
|
38
38
|
import {
|
|
39
39
|
getEventCatalogConfigFile,
|
|
40
40
|
verifyRequiredFieldsAreInCatalogConfigFile
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-6QENHZZP.js";
|
|
42
42
|
|
|
43
43
|
// src/eventcatalog.ts
|
|
44
44
|
import { Command } from "commander";
|