@eventcatalog/core 5.0.0-beta.19 → 5.0.0-beta.20
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-ZO55EMCM.js → chunk-3VQSVQTU.js} +1 -1
- package/dist/{chunk-XGIDF7WX.js → chunk-5ZUN2TXB.js} +1 -1
- package/dist/{chunk-UIUCUPK6.js → chunk-F236OJZD.js} +1 -1
- package/dist/{chunk-NQN3GVXD.js → chunk-FWH5T6U4.js} +1 -1
- package/dist/{chunk-YT2TD27M.js → chunk-R2X4ZEF6.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/src/components/Search/SearchModal.tsx +2 -10
- package/eventcatalog/src/components/Search/search-utils.ts +26 -0
- package/package.json +3 -3
|
@@ -176,7 +176,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
176
176
|
var import_os = __toESM(require("os"), 1);
|
|
177
177
|
|
|
178
178
|
// package.json
|
|
179
|
-
var version = "5.0.0-beta.
|
|
179
|
+
var version = "5.0.0-beta.20";
|
|
180
180
|
|
|
181
181
|
// src/constants.ts
|
|
182
182
|
var VERSION = version;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-5ZUN2TXB.js";
|
|
4
4
|
import "../chunk-AWOO63ME.js";
|
|
5
5
|
import "../chunk-ZAZHAVKB.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-FWH5T6U4.js";
|
|
7
7
|
import "../chunk-CPW6G62V.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-R2X4ZEF6.js";
|
|
9
9
|
import "../chunk-RFIXKATC.js";
|
|
10
10
|
export {
|
|
11
11
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -181,7 +181,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
181
181
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
182
182
|
|
|
183
183
|
// package.json
|
|
184
|
-
var version = "5.0.0-beta.
|
|
184
|
+
var version = "5.0.0-beta.20";
|
|
185
185
|
|
|
186
186
|
// src/constants.ts
|
|
187
187
|
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-5ZUN2TXB.js";
|
|
8
8
|
import {
|
|
9
9
|
getLicenseStatus,
|
|
10
10
|
printLicenseStatus
|
|
@@ -33,10 +33,10 @@ import {
|
|
|
33
33
|
} from "./chunk-MDWB5HLO.js";
|
|
34
34
|
import {
|
|
35
35
|
generate
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-3VQSVQTU.js";
|
|
37
37
|
import {
|
|
38
38
|
logger
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-F236OJZD.js";
|
|
40
40
|
import {
|
|
41
41
|
resolve_catalog_dependencies_default
|
|
42
42
|
} from "./chunk-36RYTYT5.js";
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
import {
|
|
51
51
|
watch
|
|
52
52
|
} from "./chunk-U63GDPPY.js";
|
|
53
|
-
import "./chunk-
|
|
53
|
+
import "./chunk-FWH5T6U4.js";
|
|
54
54
|
import "./chunk-CPW6G62V.js";
|
|
55
55
|
import {
|
|
56
56
|
getAstroConfigPath
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
} from "./chunk-LFQJXLHG.js";
|
|
68
68
|
import {
|
|
69
69
|
VERSION
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-R2X4ZEF6.js";
|
|
71
71
|
import {
|
|
72
72
|
getEventCatalogConfigFile,
|
|
73
73
|
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 = "5.0.0-beta.
|
|
115
|
+
var version = "5.0.0-beta.20";
|
|
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-3VQSVQTU.js";
|
|
4
|
+
import "./chunk-F236OJZD.js";
|
|
5
|
+
import "./chunk-R2X4ZEF6.js";
|
|
6
6
|
import "./chunk-RFIXKATC.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
getUrlForSearchItem,
|
|
35
35
|
highlightQuery,
|
|
36
36
|
mapPagefindResultsToSearchItems,
|
|
37
|
+
rankResourceSearchItems,
|
|
37
38
|
type SearchItem,
|
|
38
39
|
type SearchNode,
|
|
39
40
|
} from './search-utils';
|
|
@@ -316,16 +317,7 @@ export default function SearchModal() {
|
|
|
316
317
|
return items;
|
|
317
318
|
}
|
|
318
319
|
|
|
319
|
-
|
|
320
|
-
return items.filter((item) => {
|
|
321
|
-
if (item.name.toLowerCase().includes(lowerQuery)) return true;
|
|
322
|
-
// Key format is "type:id:version" (e.g. "service:OrdersService:0.0.3").
|
|
323
|
-
// Match against the id so users can find resources by their raw id too.
|
|
324
|
-
const keyParts = item.key?.split(':') ?? [];
|
|
325
|
-
const id = keyParts[1];
|
|
326
|
-
if (id?.toLowerCase().includes(lowerQuery)) return true;
|
|
327
|
-
return !!item.rawNode.summary && item.rawNode.summary.toLowerCase().includes(lowerQuery);
|
|
328
|
-
});
|
|
320
|
+
return rankResourceSearchItems(items, query);
|
|
329
321
|
}, [indexedItems, isIndexedSearch, items, query]);
|
|
330
322
|
|
|
331
323
|
const filters = useMemo(() => {
|
|
@@ -168,6 +168,32 @@ export const getIndexedResultRank = ({
|
|
|
168
168
|
return 0;
|
|
169
169
|
};
|
|
170
170
|
|
|
171
|
+
/**
|
|
172
|
+
* How well a resource matches a resource search query: an exact name (5), a name starting with
|
|
173
|
+
* the query (4) or containing it (3), then the id (2), then the summary (1). 0 is no match.
|
|
174
|
+
*/
|
|
175
|
+
export const getResourceResultRank = (item: Pick<SearchItem, 'name' | 'key' | 'rawNode'>, query: string) => {
|
|
176
|
+
const lowerQuery = query.toLowerCase();
|
|
177
|
+
const name = item.name.toLowerCase();
|
|
178
|
+
if (name === lowerQuery) return 5;
|
|
179
|
+
if (name.startsWith(lowerQuery)) return 4;
|
|
180
|
+
if (name.includes(lowerQuery)) return 3;
|
|
181
|
+
// Key format is "type:id:version" (e.g. "service:OrdersService:0.0.3").
|
|
182
|
+
// Match against the id so users can find resources by their raw id too.
|
|
183
|
+
const id = item.key?.split(':')[1];
|
|
184
|
+
if (id?.toLowerCase().includes(lowerQuery)) return 2;
|
|
185
|
+
if (item.rawNode.summary?.toLowerCase().includes(lowerQuery)) return 1;
|
|
186
|
+
return 0;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
/** Resources that match a resource search query, best matches first (index order within a rank) */
|
|
190
|
+
export const rankResourceSearchItems = <T extends Pick<SearchItem, 'name' | 'key' | 'rawNode'>>(items: T[], query: string) =>
|
|
191
|
+
items
|
|
192
|
+
.map((item, index) => ({ item, index, rank: getResourceResultRank(item, query) }))
|
|
193
|
+
.filter(({ rank }) => rank > 0)
|
|
194
|
+
.sort((a, b) => b.rank - a.rank || a.index - b.index)
|
|
195
|
+
.map(({ item }) => item);
|
|
196
|
+
|
|
171
197
|
export const applyActiveFilter = <T extends { type: string }>(items: T[], activeFilter: string) => {
|
|
172
198
|
if (activeFilter === 'all') {
|
|
173
199
|
return items;
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"license": "BUSL-1.1",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"version": "5.0.0-beta.
|
|
10
|
+
"version": "5.0.0-beta.20",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
@@ -142,8 +142,8 @@
|
|
|
142
142
|
"yjs": "^13.6.33",
|
|
143
143
|
"zod": "^4.3.6",
|
|
144
144
|
"@eventcatalog/linter": "1.2.0-beta.3",
|
|
145
|
-
"@eventcatalog/
|
|
146
|
-
"@eventcatalog/
|
|
145
|
+
"@eventcatalog/visualiser": "^5.0.0-beta.6",
|
|
146
|
+
"@eventcatalog/sdk": "2.30.0-beta.1"
|
|
147
147
|
},
|
|
148
148
|
"devDependencies": {
|
|
149
149
|
"@astrojs/check": "^0.9.10",
|