@eventcatalog/core 4.5.1 → 4.6.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.
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(analytics_exports);
36
36
  var import_os = __toESM(require("os"), 1);
37
37
 
38
38
  // package.json
39
- var version = "4.5.1";
39
+ var version = "4.6.0";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-UN7YRZ7M.js";
4
- import "../chunk-P6WOHEUC.js";
3
+ } from "../chunk-SXQSNSUH.js";
4
+ import "../chunk-XBFXBRPC.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -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.5.1";
143
+ var version = "4.6.0";
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-Q7IVWFSR.js";
3
+ } from "../chunk-VD4WSIHN.js";
4
4
  import "../chunk-K2XIENVT.js";
5
- import "../chunk-UN7YRZ7M.js";
6
- import "../chunk-P6WOHEUC.js";
5
+ import "../chunk-SXQSNSUH.js";
6
+ import "../chunk-XBFXBRPC.js";
7
7
  import "../chunk-6QENHZZP.js";
8
8
  export {
9
9
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-P6WOHEUC.js";
3
+ } from "./chunk-XBFXBRPC.js";
4
4
 
5
5
  // src/utils/cli-logger.ts
6
6
  import pc from "picocolors";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-2L33NO2M.js";
3
+ } from "./chunk-BYW3E5I3.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-P6WOHEUC.js";
3
+ } from "./chunk-XBFXBRPC.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import os from "os";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-K2XIENVT.js";
5
5
  import {
6
6
  raiseEvent
7
- } from "./chunk-UN7YRZ7M.js";
7
+ } from "./chunk-SXQSNSUH.js";
8
8
  import {
9
9
  getEventCatalogConfigFile,
10
10
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "4.5.1";
2
+ var version = "4.6.0";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "4.5.1";
28
+ var version = "4.6.0";
29
29
 
30
30
  // src/constants.ts
31
31
  var VERSION = version;
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-P6WOHEUC.js";
3
+ } from "./chunk-XBFXBRPC.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -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.5.1";
147
+ var version = "4.6.0";
148
148
 
149
149
  // src/constants.ts
150
150
  var VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  log_build_default
3
- } from "./chunk-Q7IVWFSR.js";
3
+ } from "./chunk-VD4WSIHN.js";
4
4
  import "./chunk-K2XIENVT.js";
5
5
  import {
6
6
  runMigrations
@@ -14,10 +14,10 @@ import {
14
14
  } from "./chunk-B7HCX5HM.js";
15
15
  import {
16
16
  generate
17
- } from "./chunk-SHSMDJCQ.js";
17
+ } from "./chunk-DIVHIZPM.js";
18
18
  import {
19
19
  logger
20
- } from "./chunk-2L33NO2M.js";
20
+ } from "./chunk-BYW3E5I3.js";
21
21
  import {
22
22
  resolve_catalog_dependencies_default
23
23
  } from "./chunk-LHR4G2UO.js";
@@ -27,7 +27,7 @@ import {
27
27
  import {
28
28
  watch
29
29
  } from "./chunk-CAJUIMDJ.js";
30
- import "./chunk-UN7YRZ7M.js";
30
+ import "./chunk-SXQSNSUH.js";
31
31
  import {
32
32
  createAstroDevLineFilter,
33
33
  createAstroLineFilter
@@ -38,7 +38,7 @@ import {
38
38
  import "./chunk-W5JQON7Z.js";
39
39
  import {
40
40
  VERSION
41
- } from "./chunk-P6WOHEUC.js";
41
+ } from "./chunk-XBFXBRPC.js";
42
42
  import {
43
43
  linkCoreNodeModules,
44
44
  resolveInstalledCoreNodeModules
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.5.1";
111
+ var version = "4.6.0";
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-SHSMDJCQ.js";
4
- import "./chunk-2L33NO2M.js";
5
- import "./chunk-P6WOHEUC.js";
3
+ } from "./chunk-DIVHIZPM.js";
4
+ import "./chunk-BYW3E5I3.js";
5
+ import "./chunk-XBFXBRPC.js";
6
6
  import "./chunk-6QENHZZP.js";
7
7
  export {
8
8
  generate
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(cli_logger_exports);
36
36
  var import_picocolors = __toESM(require("picocolors"), 1);
37
37
 
38
38
  // package.json
39
- var version = "4.5.1";
39
+ var version = "4.6.0";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  logger
3
- } from "../chunk-2L33NO2M.js";
4
- import "../chunk-P6WOHEUC.js";
3
+ } from "../chunk-BYW3E5I3.js";
4
+ import "../chunk-XBFXBRPC.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -9,7 +9,7 @@ import path from 'path';
9
9
  import { userTeamDirectoryLoader } from './enterprise/directory/user-team-directory';
10
10
  import config from '@config';
11
11
  import { schemaLoader } from './utils/collections/schema-loader';
12
- import { globWithSafeWatcher, withIgnoredBuildArtifacts } from './utils/collections/glob-loader';
12
+ import { globWithSafeWatcher, withFederatedContent, withIgnoredBuildArtifacts } from './utils/collections/glob-loader';
13
13
  import { withExtensionProperties } from './utils/collections/extension-properties';
14
14
 
15
15
  // Enterprise Collections
@@ -494,24 +494,26 @@ const dataProducts = defineCollection({
494
494
 
495
495
  const services = defineCollection({
496
496
  loader: globWithSafeWatcher({
497
- pattern: withIgnoredBuildArtifacts([
498
- 'domains/*/services/*/index.(md|mdx)',
499
- 'domains/*/services/*/versioned/*/index.(md|mdx)',
500
-
501
- // Capture subdomain folders
502
- 'domains/*/subdomains/*/services/*/index.(md|mdx)',
503
- 'domains/*/subdomains/*/services/*/versioned/*/index.(md|mdx)',
504
-
505
- // Capture services inside systems
506
- 'systems/*/services/*/index.(md|mdx)',
507
- 'systems/*/services/*/versioned/*/index.(md|mdx)',
508
- 'domains/*/systems/*/services/*/index.(md|mdx)',
509
- 'domains/*/systems/*/services/*/versioned/*/index.(md|mdx)',
510
-
511
- // Capture services in the root
512
- 'services/*/index.(md|mdx)', // Capture only services markdown files
513
- 'services/*/versioned/*/index.(md|mdx)', // ✅ Capture versioned files inside services
514
- ]),
497
+ pattern: withIgnoredBuildArtifacts(
498
+ withFederatedContent([
499
+ 'domains/*/services/*/index.(md|mdx)',
500
+ 'domains/*/services/*/versioned/*/index.(md|mdx)',
501
+
502
+ // Capture subdomain folders
503
+ 'domains/*/subdomains/*/services/*/index.(md|mdx)',
504
+ 'domains/*/subdomains/*/services/*/versioned/*/index.(md|mdx)',
505
+
506
+ // Capture services inside systems
507
+ 'systems/*/services/*/index.(md|mdx)',
508
+ 'systems/*/services/*/versioned/*/index.(md|mdx)',
509
+ 'domains/*/systems/*/services/*/index.(md|mdx)',
510
+ 'domains/*/systems/*/services/*/versioned/*/index.(md|mdx)',
511
+
512
+ // Capture services in the root
513
+ 'services/*/index.(md|mdx)', // ✅ Capture only services markdown files
514
+ 'services/*/versioned/*/index.(md|mdx)', // ✅ Capture versioned files inside services
515
+ ])
516
+ ),
515
517
  base: projectDirBase,
516
518
  generateId: ({ data, ...rest }) => {
517
519
  return `${data.id}-${data.version}`;
@@ -730,14 +732,16 @@ const resourceDocs = defineCollection({
730
732
  loader: globWithSafeWatcher({
731
733
  // Resource-level docs are restricted to known resource paths.
732
734
  // This avoids scanning external docs such as node_modules/**/docs.
733
- pattern: withIgnoredBuildArtifacts([
734
- '{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/docs/**/*.@(md|mdx)',
735
- '{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/docs/*.@(md|mdx)',
736
- '{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/versioned/*/docs/**/*.@(md|mdx)',
737
- '{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/versioned/*/docs/*.@(md|mdx)',
738
- 'domains/**/docs/**/*.@(md|mdx)',
739
- 'domains/**/docs/*.@(md|mdx)',
740
- ]),
735
+ pattern: withIgnoredBuildArtifacts(
736
+ withFederatedContent([
737
+ '{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/docs/**/*.@(md|mdx)',
738
+ '{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/docs/*.@(md|mdx)',
739
+ '{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/versioned/*/docs/**/*.@(md|mdx)',
740
+ '{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/versioned/*/docs/*.@(md|mdx)',
741
+ 'domains/**/docs/**/*.@(md|mdx)',
742
+ 'domains/**/docs/*.@(md|mdx)',
743
+ ])
744
+ ),
741
745
  base: projectDirBase,
742
746
  }),
743
747
  schema: resourceDocsSchema,
@@ -745,16 +749,18 @@ const resourceDocs = defineCollection({
745
749
 
746
750
  const resourceDocCategories = defineCollection({
747
751
  loader: globWithSafeWatcher({
748
- pattern: withIgnoredBuildArtifacts([
749
- '{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/docs/**/category.json',
750
- '{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/docs/**/_category_.json',
751
- '{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/versioned/*/docs/**/category.json',
752
- '{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/versioned/*/docs/**/_category_.json',
753
- 'domains/**/docs/**/category.json',
754
- 'domains/**/docs/**/_category_.json',
755
- 'domains/**/docs/category.json',
756
- 'domains/**/docs/_category_.json',
757
- ]),
752
+ pattern: withIgnoredBuildArtifacts(
753
+ withFederatedContent([
754
+ '{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/docs/**/category.json',
755
+ '{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/docs/**/_category_.json',
756
+ '{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/versioned/*/docs/**/category.json',
757
+ '{agents,events,commands,queries,services,flows,containers,channels,entities,data-products,systems}/**/versioned/*/docs/**/_category_.json',
758
+ 'domains/**/docs/**/category.json',
759
+ 'domains/**/docs/**/_category_.json',
760
+ 'domains/**/docs/category.json',
761
+ 'domains/**/docs/_category_.json',
762
+ ])
763
+ ),
758
764
  base: projectDirBase,
759
765
  }),
760
766
  schema: resourceDocCategoriesSchema,
@@ -762,15 +768,17 @@ const resourceDocCategories = defineCollection({
762
768
 
763
769
  const domains = defineCollection({
764
770
  loader: globWithSafeWatcher({
765
- pattern: withIgnoredBuildArtifacts([
766
- // ✅ Strictly include only index.md at the expected levels
767
- 'domains/*/index.(md|mdx)',
768
- 'domains/*/versioned/*/index.(md|mdx)',
769
-
770
- // Capture subdomain folders
771
- 'domains/*/subdomains/*/index.(md|mdx)',
772
- 'domains/*/subdomains/*/versioned/*/index.(md|mdx)',
773
- ]),
771
+ pattern: withIgnoredBuildArtifacts(
772
+ withFederatedContent([
773
+ // ✅ Strictly include only index.md at the expected levels
774
+ 'domains/*/index.(md|mdx)',
775
+ 'domains/*/versioned/*/index.(md|mdx)',
776
+
777
+ // Capture subdomain folders
778
+ 'domains/*/subdomains/*/index.(md|mdx)',
779
+ 'domains/*/subdomains/*/versioned/*/index.(md|mdx)',
780
+ ])
781
+ ),
774
782
  base: projectDirBase,
775
783
  generateId: ({ data, ...rest }) => {
776
784
  return `${data.id}-${data.version}`;
@@ -938,10 +946,9 @@ const channels = defineCollection({
938
946
 
939
947
  const ubiquitousLanguages = defineCollection({
940
948
  loader: globWithSafeWatcher({
941
- pattern: withIgnoredBuildArtifacts([
942
- 'domains/*/ubiquitous-language.(md|mdx)',
943
- 'domains/*/subdomains/*/ubiquitous-language.(md|mdx)',
944
- ]),
949
+ pattern: withIgnoredBuildArtifacts(
950
+ withFederatedContent(['domains/*/ubiquitous-language.(md|mdx)', 'domains/*/subdomains/*/ubiquitous-language.(md|mdx)'])
951
+ ),
945
952
  base: projectDirBase,
946
953
  generateId: ({ data }) => {
947
954
  // File has no id, so we need to generate one
@@ -1039,7 +1046,7 @@ const users = defineCollection({
1039
1046
  sources: config.directory?.sources,
1040
1047
  conflictStrategy: config.directory?.conflictStrategy,
1041
1048
  local: {
1042
- pattern: withIgnoredBuildArtifacts('users/*.(md|mdx)'),
1049
+ pattern: withIgnoredBuildArtifacts(withFederatedContent('users/*.(md|mdx)')),
1043
1050
  base: projectDirBase,
1044
1051
  generateId: ({ data }) => data.id as string,
1045
1052
  },
@@ -1071,7 +1078,7 @@ const teams = defineCollection({
1071
1078
  sources: config.directory?.sources,
1072
1079
  conflictStrategy: config.directory?.conflictStrategy,
1073
1080
  local: {
1074
- pattern: withIgnoredBuildArtifacts('teams/*.(md|mdx)'),
1081
+ pattern: withIgnoredBuildArtifacts(withFederatedContent('teams/*.(md|mdx)')),
1075
1082
  base: projectDirBase,
1076
1083
  generateId: ({ data }) => data.id as string,
1077
1084
  },
@@ -5,6 +5,7 @@ const { title, logo } = config;
5
5
  import { join } from 'node:path';
6
6
  import { isAuthEnabled, isSSR } from '@utils/feature';
7
7
  import { buildUrl } from '@utils/url-builder';
8
+ import { getSession } from 'auth-astro/server';
8
9
 
9
10
  const catalogDirectory = process.env.PROJECT_DIR || process.cwd();
10
11
 
@@ -32,7 +33,6 @@ if (!isSSR() || !isAuthEnabled()) {
32
33
 
33
34
  // If we are in SSR mode, check if the user is already logged in
34
35
  if (isSSR() && isAuthEnabled()) {
35
- const { getSession } = await import(/* @vite-ignore */ 'auth-astro/server');
36
36
  const session = await getSession(Astro.request);
37
37
  if (session) {
38
38
  return Astro.redirect('/');
@@ -0,0 +1,20 @@
1
+ import picomatch from 'picomatch';
2
+ import { describe, expect, it } from 'vitest';
3
+ import { withFederatedContent } from './glob-loader';
4
+
5
+ describe('withFederatedContent', () => {
6
+ it('loads root catalog content from every federated source directory', () => {
7
+ const patterns = withFederatedContent(['services/*/index.(md|mdx)', 'domains/*/index.(md|mdx)', '!domains/*/services/**']);
8
+
9
+ expect(patterns).toEqual([
10
+ 'services/*/index.(md|mdx)',
11
+ 'domains/*/index.(md|mdx)',
12
+ '!domains/*/services/**',
13
+ 'federated/*/services/*/index.(md|mdx)',
14
+ 'federated/*/domains/*/index.(md|mdx)',
15
+ '!federated/*/domains/*/services/**',
16
+ ]);
17
+ expect(picomatch.isMatch('federated/team-payments--abc123/services/payment-service/index.mdx', patterns)).toBe(true);
18
+ expect(picomatch.isMatch('federated/team-payments--abc123/domains/payments/index.mdx', patterns)).toBe(true);
19
+ });
20
+ });
@@ -15,6 +15,17 @@ export const withIgnoredBuildArtifacts = (patterns: string | string[]) => {
15
15
 
16
16
  const toPatterns = (patterns: string | string[]) => (Array.isArray(patterns) ? patterns : [patterns]);
17
17
 
18
+ export const withFederatedContent = (patterns: string | string[]) => {
19
+ const patternList = toPatterns(patterns);
20
+ const federatedPatterns = patternList.map((pattern) => {
21
+ const isNegative = pattern.startsWith('!');
22
+ const catalogPattern = isNegative ? pattern.slice(1) : pattern;
23
+ return `${isNegative ? '!' : ''}federated/*/${catalogPattern}`;
24
+ });
25
+
26
+ return [...patternList, ...federatedPatterns];
27
+ };
28
+
18
29
  const matchesGlobPattern = (entry: string, patterns: string | string[]) => {
19
30
  const patternList = toPatterns(patterns);
20
31
  const positivePatterns = patternList.filter((pattern) => !pattern.startsWith('!'));
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "license": "SEE LICENSE IN LICENSE",
9
9
  "type": "module",
10
- "version": "4.5.1",
10
+ "version": "4.6.0",
11
11
  "publishConfig": {
12
12
  "access": "public"
13
13
  },
@@ -119,9 +119,9 @@
119
119
  "update-notifier": "^7.3.1",
120
120
  "uuid": "^10.0.0",
121
121
  "zod": "^4.3.6",
122
- "@eventcatalog/linter": "1.1.8",
122
+ "@eventcatalog/linter": "1.1.10",
123
123
  "@eventcatalog/visualiser": "^4.1.1",
124
- "@eventcatalog/sdk": "2.26.3"
124
+ "@eventcatalog/sdk": "2.27.1"
125
125
  },
126
126
  "devDependencies": {
127
127
  "@astrojs/check": "^0.9.9",