@eventcatalog/core 4.12.0-beta.3 → 4.12.0-beta.4
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-GGPT4I3K.js → chunk-AHPVNJ7S.js} +1 -1
- package/dist/{chunk-56TJHDS2.js → chunk-GTXK64UD.js} +1 -1
- package/dist/{chunk-TAGBLT3L.js → chunk-M4MMC5MN.js} +1 -1
- package/dist/{chunk-5MBYZHYS.js → chunk-NAGVDHNB.js} +1 -1
- package/dist/{chunk-AVRFMQJX.js → chunk-ZZSCV5ZI.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +5 -5
- 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/astro.config.mjs +2 -2
- package/eventcatalog/integrations/client-dependencies.mjs +126 -27
- package/eventcatalog/src/components/ChatPanel/ChatPanel.tsx +4 -2
- package/eventcatalog/src/components/SchemaExplorer/JSONSchemaViewer.tsx +3 -2
- package/package.json +3 -3
|
@@ -146,7 +146,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
146
146
|
var import_os = __toESM(require("os"), 1);
|
|
147
147
|
|
|
148
148
|
// package.json
|
|
149
|
-
var version = "4.12.0-beta.
|
|
149
|
+
var version = "4.12.0-beta.4";
|
|
150
150
|
|
|
151
151
|
// src/constants.ts
|
|
152
152
|
var VERSION = version;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-NAGVDHNB.js";
|
|
4
4
|
import "../chunk-ZAZHAVKB.js";
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-AHPVNJ7S.js";
|
|
6
|
+
import "../chunk-ZZSCV5ZI.js";
|
|
7
7
|
import "../chunk-JE6RX7SJ.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
|
@@ -151,7 +151,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
151
151
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
152
152
|
|
|
153
153
|
// package.json
|
|
154
|
-
var version = "4.12.0-beta.
|
|
154
|
+
var version = "4.12.0-beta.4";
|
|
155
155
|
|
|
156
156
|
// src/constants.ts
|
|
157
157
|
var VERSION = version;
|
package/dist/eventcatalog.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import "./chunk-CA4U2JP7.js";
|
|
5
5
|
import {
|
|
6
6
|
log_build_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NAGVDHNB.js";
|
|
8
8
|
import "./chunk-ZAZHAVKB.js";
|
|
9
9
|
import {
|
|
10
10
|
FederationConflictError,
|
|
@@ -30,10 +30,10 @@ import {
|
|
|
30
30
|
} from "./chunk-3SJDIENM.js";
|
|
31
31
|
import {
|
|
32
32
|
generate
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-GTXK64UD.js";
|
|
34
34
|
import {
|
|
35
35
|
logger
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-M4MMC5MN.js";
|
|
37
37
|
import {
|
|
38
38
|
resolve_catalog_dependencies_default
|
|
39
39
|
} from "./chunk-EEZXGNF6.js";
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
import {
|
|
48
48
|
watch
|
|
49
49
|
} from "./chunk-U63GDPPY.js";
|
|
50
|
-
import "./chunk-
|
|
50
|
+
import "./chunk-AHPVNJ7S.js";
|
|
51
51
|
import {
|
|
52
52
|
getAstroConfigPath
|
|
53
53
|
} from "./chunk-VIJJ7JKH.js";
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
} from "./chunk-SAN4U2WU.js";
|
|
63
63
|
import {
|
|
64
64
|
VERSION
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-ZZSCV5ZI.js";
|
|
66
66
|
import {
|
|
67
67
|
getEventCatalogConfigFile,
|
|
68
68
|
verifyRequiredFieldsAreInCatalogConfigFile
|
package/dist/generate.cjs
CHANGED
|
@@ -112,7 +112,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
|
112
112
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
113
113
|
|
|
114
114
|
// package.json
|
|
115
|
-
var version = "4.12.0-beta.
|
|
115
|
+
var version = "4.12.0-beta.4";
|
|
116
116
|
|
|
117
117
|
// src/constants.ts
|
|
118
118
|
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-GTXK64UD.js";
|
|
4
|
+
import "./chunk-M4MMC5MN.js";
|
|
5
|
+
import "./chunk-ZZSCV5ZI.js";
|
|
6
6
|
import "./chunk-JE6RX7SJ.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -34,7 +34,7 @@ import preprocessExpressiveCodeConfig from './integrations/expressive-code-confi
|
|
|
34
34
|
import catalogAssets from './integrations/catalog-assets.mjs';
|
|
35
35
|
import runtimeDependencies from './integrations/runtime-dependencies.mjs';
|
|
36
36
|
import { getRuntimePaths } from './integrations/runtime-paths.mjs';
|
|
37
|
-
import {
|
|
37
|
+
import { collectClientDependencies } from './integrations/client-dependencies.mjs';
|
|
38
38
|
|
|
39
39
|
const projectDirectory = process.env.PROJECT_DIR || process.cwd();
|
|
40
40
|
const { runtimeDirectory } = getRuntimePaths(projectDirectory, process.env.CATALOG_DIR);
|
|
@@ -219,7 +219,7 @@ export default defineConfig({
|
|
|
219
219
|
},
|
|
220
220
|
optimizeDeps: {
|
|
221
221
|
exclude: [],
|
|
222
|
-
include:
|
|
222
|
+
include: collectClientDependencies(),
|
|
223
223
|
},
|
|
224
224
|
},
|
|
225
225
|
});
|
|
@@ -1,27 +1,126 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { getRuntimeAliases, packageDirectory } from './eventcatalog-runtime.mjs';
|
|
4
|
+
|
|
5
|
+
// In an installed catalog Core's browser components live in node_modules, and
|
|
6
|
+
// Vite never discovers dependencies imported from there. Anything it serves
|
|
7
|
+
// unoptimized reaches the browser raw, so a CommonJS package anywhere in the
|
|
8
|
+
// tree (e.g. react-markdown > hast-util-to-jsx-runtime > style-to-js) breaks
|
|
9
|
+
// hydration. Astro's own crawl (vitefu) only covers Core's direct CommonJS
|
|
10
|
+
// dependencies. Collect every dependency Core's browser code imports instead,
|
|
11
|
+
// so Vite pre-bundles each one together with its nested dependencies.
|
|
12
|
+
//
|
|
13
|
+
// Entrypoints are React components and processed <script> blocks in .astro
|
|
14
|
+
// files. Local and aliased JavaScript/TypeScript imports are followed. Like the
|
|
15
|
+
// server dependency scan this matches literal imports rather than parsing, so
|
|
16
|
+
// commented-out imports can over-include; computed specifiers are not found.
|
|
17
|
+
|
|
18
|
+
// Always needed by React islands, even before a component imports them directly.
|
|
19
|
+
const baseDependencies = ['react', 'react-dom', 'react-dom/client', 'react/jsx-runtime', 'react/jsx-dev-runtime'];
|
|
20
|
+
|
|
21
|
+
const scriptExtensions = ['.ts', '.tsx', '.js', '.jsx', '.mjs'];
|
|
22
|
+
const typeOnlyImport = /\b(?:import|export)\s+type\s+[^'";]*?\bfrom\s*['"][^'"]+['"]/g;
|
|
23
|
+
const importSpecifier = /\b(?:from\s*|import\s*(?:\(\s*)?)['"]([^'"]+)['"]/g;
|
|
24
|
+
const astroScript = /<script\b([^>]*)>([\s\S]*?)<\/script>/g;
|
|
25
|
+
|
|
26
|
+
const packageName = (specifier) =>
|
|
27
|
+
specifier
|
|
28
|
+
.split('/')
|
|
29
|
+
.slice(0, specifier.startsWith('@') ? 2 : 1)
|
|
30
|
+
.join('/');
|
|
31
|
+
|
|
32
|
+
const isTestFile = (file) => /\.(?:test|spec)\.[cm]?[jt]sx?$/.test(file) || file.split(path.sep).includes('__tests__');
|
|
33
|
+
|
|
34
|
+
function resolveFile(file) {
|
|
35
|
+
const candidates = [
|
|
36
|
+
file,
|
|
37
|
+
...scriptExtensions.map((extension) => file + extension),
|
|
38
|
+
...scriptExtensions.map((extension) => path.join(file, `index${extension}`)),
|
|
39
|
+
];
|
|
40
|
+
return candidates.find(
|
|
41
|
+
(candidate) =>
|
|
42
|
+
scriptExtensions.includes(path.extname(candidate)) && fs.existsSync(candidate) && fs.statSync(candidate).isFile()
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function findPackageJson(name, fromDirectory) {
|
|
47
|
+
for (let directory = fromDirectory; ; directory = path.dirname(directory)) {
|
|
48
|
+
const file = path.join(directory, 'node_modules', name, 'package.json');
|
|
49
|
+
if (fs.existsSync(file)) return JSON.parse(fs.readFileSync(file, 'utf-8'));
|
|
50
|
+
if (path.dirname(directory) === directory) return;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Astro excludes its framework packages (those built on astro) from
|
|
55
|
+
// pre-bundling because they ship raw .astro files. Match its detection.
|
|
56
|
+
function isAstroPackage(name, coreDirectory) {
|
|
57
|
+
const pkg = findPackageJson(name, coreDirectory);
|
|
58
|
+
return name === 'astro' || Boolean(pkg?.dependencies?.astro || pkg?.peerDependencies?.astro);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function listFiles(directory) {
|
|
62
|
+
return fs.readdirSync(directory, { withFileTypes: true }).flatMap((entry) => {
|
|
63
|
+
if (entry.name.startsWith('.') || entry.name === 'node_modules') return [];
|
|
64
|
+
const file = path.join(directory, entry.name);
|
|
65
|
+
return entry.isDirectory() ? listFiles(file) : [file];
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function collectClientDependencies(coreDirectory = packageDirectory) {
|
|
70
|
+
const { dependencies = {} } = JSON.parse(fs.readFileSync(path.join(coreDirectory, '../package.json'), 'utf-8'));
|
|
71
|
+
// Only Core's own source aliases matter here; catalog-owned aliases point at
|
|
72
|
+
// the user's project, which Vite already scans normally.
|
|
73
|
+
const aliases = getRuntimeAliases({ projectDirectory: coreDirectory, runtimeDirectory: coreDirectory, coreDirectory }).filter(
|
|
74
|
+
({ replacement }) => replacement.startsWith(path.join(coreDirectory, 'src'))
|
|
75
|
+
);
|
|
76
|
+
const resolveAlias = (specifier) => {
|
|
77
|
+
for (const { find, replacement } of aliases) {
|
|
78
|
+
if (find instanceof RegExp) {
|
|
79
|
+
if (find.test(specifier)) return specifier.replace(find, replacement);
|
|
80
|
+
} else if (specifier === find || specifier.startsWith(`${find}/`)) {
|
|
81
|
+
return replacement + specifier.slice(find.length);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const found = new Set(baseDependencies);
|
|
87
|
+
const visited = new Set();
|
|
88
|
+
const queue = [];
|
|
89
|
+
|
|
90
|
+
const scan = (code, importer) => {
|
|
91
|
+
for (const [, specifier] of code.replace(typeOnlyImport, '').matchAll(importSpecifier)) {
|
|
92
|
+
// Vite owns query imports (for example ?raw assets) and stylesheets.
|
|
93
|
+
if (/[?#]/.test(specifier) || /\.(?:css|scss|sass|less)$/.test(specifier)) continue;
|
|
94
|
+
const local = specifier.startsWith('.') ? path.resolve(path.dirname(importer), specifier) : resolveAlias(specifier);
|
|
95
|
+
if (local !== undefined) {
|
|
96
|
+
const file = resolveFile(local);
|
|
97
|
+
if (file && !visited.has(file)) queue.push(file);
|
|
98
|
+
} else if (Object.hasOwn(dependencies, packageName(specifier))) {
|
|
99
|
+
found.add(specifier);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
for (const file of listFiles(path.join(coreDirectory, 'src'))) {
|
|
105
|
+
if (isTestFile(file)) continue;
|
|
106
|
+
if (/\.[jt]sx$/.test(file)) {
|
|
107
|
+
queue.push(file);
|
|
108
|
+
} else if (file.endsWith('.astro')) {
|
|
109
|
+
for (const [, attributes, code] of fs.readFileSync(file, 'utf-8').matchAll(astroScript)) {
|
|
110
|
+
// Inline, external and data scripts are not processed by Vite.
|
|
111
|
+
if (/\bis:inline\b|\bsrc\s*=|\btype\s*=\s*['"]?(?!module)/.test(attributes)) continue;
|
|
112
|
+
scan(code, file);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
while (queue.length > 0) {
|
|
118
|
+
const file = queue.pop();
|
|
119
|
+
if (visited.has(file) || isTestFile(file)) continue;
|
|
120
|
+
visited.add(file);
|
|
121
|
+
scan(fs.readFileSync(file, 'utf-8'), file);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const astroPackages = new Set([...found].map(packageName).filter((name) => isAstroPackage(name, coreDirectory)));
|
|
125
|
+
return [...found].filter((specifier) => !astroPackages.has(packageName(specifier))).sort();
|
|
126
|
+
}
|
|
@@ -847,8 +847,10 @@ const ChatPanel = ({ isOpen, onClose, configured = false }: ChatPanelProps) => {
|
|
|
847
847
|
|
|
848
848
|
return (
|
|
849
849
|
<>
|
|
850
|
-
{/* Keyframes for fade-in animation - using constant to avoid re-injection
|
|
851
|
-
|
|
850
|
+
{/* Keyframes for fade-in animation - using constant to avoid re-injection.
|
|
851
|
+
Injected raw: React 18's server renderer escapes the `>` selectors in
|
|
852
|
+
text children, which the client doesn't, causing a hydration mismatch. */}
|
|
853
|
+
<style dangerouslySetInnerHTML={{ __html: CHAT_PANEL_STYLES }} />
|
|
852
854
|
|
|
853
855
|
{/* Panel - hidden when fullscreen modal is open */}
|
|
854
856
|
{!isFullscreen && (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState, useEffect, useRef, useMemo } from 'react';
|
|
1
|
+
import { useState, useEffect, useRef, useMemo, useId } from 'react';
|
|
2
2
|
|
|
3
3
|
interface JSONSchemaViewerProps {
|
|
4
4
|
schema: any;
|
|
@@ -293,7 +293,8 @@ const NestedVariantSelector = ({
|
|
|
293
293
|
const SchemaProperty = ({ name, details, isRequired, level, isListItem = false, expand }: SchemaPropertyProps) => {
|
|
294
294
|
const [isExpanded, setIsExpanded] = useState(expand);
|
|
295
295
|
const [selectedVariantIndex, setSelectedVariantIndex] = useState(0);
|
|
296
|
-
|
|
296
|
+
// useId keeps the server and client IDs identical during hydration.
|
|
297
|
+
const contentId = `prop-${name}-${level}-${useId()}`;
|
|
297
298
|
|
|
298
299
|
useEffect(() => {
|
|
299
300
|
setIsExpanded(expand);
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"license": "SEE LICENSE IN LICENSE",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"version": "4.12.0-beta.
|
|
10
|
+
"version": "4.12.0-beta.4",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
@@ -134,8 +134,8 @@
|
|
|
134
134
|
"uuid": "^11.1.1",
|
|
135
135
|
"zod": "^4.3.6",
|
|
136
136
|
"@eventcatalog/linter": "1.1.20",
|
|
137
|
-
"@eventcatalog/
|
|
138
|
-
"@eventcatalog/
|
|
137
|
+
"@eventcatalog/sdk": "2.29.1",
|
|
138
|
+
"@eventcatalog/visualiser": "^4.1.4"
|
|
139
139
|
},
|
|
140
140
|
"devDependencies": {
|
|
141
141
|
"@astrojs/check": "^0.9.10",
|