@eventcatalog/core 2.30.8 → 2.31.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.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/dist/analytics/analytics.cjs +1 -1
  3. package/dist/analytics/analytics.js +2 -2
  4. package/dist/analytics/log-build.cjs +9 -3
  5. package/dist/analytics/log-build.d.cts +4 -1
  6. package/dist/analytics/log-build.d.ts +4 -1
  7. package/dist/analytics/log-build.js +3 -3
  8. package/dist/{chunk-XJBJFIN7.js → chunk-4S3UNXH2.js} +1 -1
  9. package/dist/{chunk-D4IJRFPJ.js → chunk-D7LV5JLL.js} +9 -3
  10. package/dist/{chunk-NALVGTIE.js → chunk-I6OFOESY.js} +1 -1
  11. package/dist/{chunk-XMDPVKIJ.js → chunk-NJGR7XUU.js} +44 -1
  12. package/dist/constants.cjs +1 -1
  13. package/dist/constants.js +1 -1
  14. package/dist/eventcatalog.cjs +74 -14
  15. package/dist/eventcatalog.config.d.cts +28 -0
  16. package/dist/eventcatalog.config.d.ts +28 -0
  17. package/dist/eventcatalog.js +29 -16
  18. package/dist/features.cjs +46 -2
  19. package/dist/features.d.cts +2 -1
  20. package/dist/features.d.ts +2 -1
  21. package/dist/features.js +5 -3
  22. package/eventcatalog/public/images/custom-docs-placeholder.png +0 -0
  23. package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Custom.tsx +0 -2
  24. package/eventcatalog/src/components/MDX/Steps/Step.astro +1 -1
  25. package/eventcatalog/src/components/MDX/Steps/Steps.astro +15 -0
  26. package/eventcatalog/src/components/SideNav/CustomDocsNav/CustomDocsNavWrapper.tsx +11 -0
  27. package/eventcatalog/src/components/SideNav/CustomDocsNav/components/NestedItem.tsx +183 -0
  28. package/eventcatalog/src/components/SideNav/CustomDocsNav/components/NoResultsFound.tsx +21 -0
  29. package/eventcatalog/src/components/SideNav/CustomDocsNav/index.tsx +250 -0
  30. package/eventcatalog/src/components/SideNav/CustomDocsNav/types.ts +29 -0
  31. package/eventcatalog/src/components/SideNav/CustomDocsNav.astro +9 -0
  32. package/eventcatalog/src/content.config.ts +15 -24
  33. package/eventcatalog/src/enterprise/collections/custom-pages.ts +19 -0
  34. package/eventcatalog/src/enterprise/custom-documentation/collection.ts +16 -0
  35. package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/CustomDocsNavWrapper.tsx +11 -0
  36. package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/components/NestedItem.tsx +183 -0
  37. package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/components/NoResultsFound.tsx +21 -0
  38. package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/index.tsx +250 -0
  39. package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/types.ts +29 -0
  40. package/eventcatalog/src/enterprise/custom-documentation/pages/index.astro +389 -0
  41. package/eventcatalog/src/enterprise/custom-documentation/utils/custom-docs.ts +118 -0
  42. package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +58 -9
  43. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +117 -3
  44. package/eventcatalog/src/pages/docs/custom/[...path]/index.astro +260 -0
  45. package/eventcatalog/src/pages/pro/index.astro +272 -0
  46. package/eventcatalog/src/shared-collections.ts +25 -0
  47. package/eventcatalog/src/utils/eventcatalog-config/catalog.ts +12 -1
  48. package/eventcatalog/src/utils/feature.ts +5 -0
  49. package/package.json +1 -1
package/README.md CHANGED
@@ -276,4 +276,4 @@ This project follows the [all-contributors](https://github.com/all-contributors/
276
276
 
277
277
  # License
278
278
 
279
- MIT.
279
+ MIT
@@ -37,7 +37,7 @@ var import_axios = __toESM(require("axios"), 1);
37
37
  var import_os = __toESM(require("os"), 1);
38
38
 
39
39
  // package.json
40
- var version = "2.30.8";
40
+ var version = "2.31.0";
41
41
 
42
42
  // src/constants.ts
43
43
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-NALVGTIE.js";
4
- import "../chunk-XJBJFIN7.js";
3
+ } from "../chunk-I6OFOESY.js";
4
+ import "../chunk-4S3UNXH2.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -106,7 +106,7 @@ var import_axios = __toESM(require("axios"), 1);
106
106
  var import_os = __toESM(require("os"), 1);
107
107
 
108
108
  // package.json
109
- var version = "2.30.8";
109
+ var version = "2.31.0";
110
110
 
111
111
  // src/constants.ts
112
112
  var VERSION = version;
@@ -136,13 +136,19 @@ async function raiseEvent(eventData) {
136
136
  }
137
137
 
138
138
  // src/analytics/log-build.js
139
- var main = async (projectDir) => {
139
+ var main = async (projectDir, { isEventCatalogProEnabled, isBackstagePluginEnabled }) => {
140
140
  if (process.env.NODE_ENV === "CI") return;
141
141
  try {
142
142
  await verifyRequiredFieldsAreInCatalogConfigFile(projectDir);
143
143
  const configFile = await getEventCatalogConfigFile(projectDir);
144
144
  const { cId, organizationName, generators = [] } = configFile;
145
- const generatorNames = generators.length > 0 ? generators.map((generator) => generator[0]) : ["none"];
145
+ let generatorNames = generators.length > 0 ? generators.map((generator) => generator[0]) : ["none"];
146
+ if (isEventCatalogProEnabled) {
147
+ generatorNames.push("@eventcatalog/eventcatalog-pro");
148
+ }
149
+ if (isBackstagePluginEnabled) {
150
+ generatorNames.push("@eventcatalog/backstage-plugin-eventcatalog");
151
+ }
146
152
  await raiseEvent({
147
153
  command: "build",
148
154
  org: organizationName,
@@ -2,6 +2,9 @@
2
2
  *
3
3
  * @param {string} projectDir
4
4
  */
5
- declare function main(projectDir: string): Promise<void>;
5
+ declare function main(projectDir: string, { isEventCatalogProEnabled, isBackstagePluginEnabled }: {
6
+ isEventCatalogProEnabled: any;
7
+ isBackstagePluginEnabled: any;
8
+ }): Promise<void>;
6
9
 
7
10
  export { main as default };
@@ -2,6 +2,9 @@
2
2
  *
3
3
  * @param {string} projectDir
4
4
  */
5
- declare function main(projectDir: string): Promise<void>;
5
+ declare function main(projectDir: string, { isEventCatalogProEnabled, isBackstagePluginEnabled }: {
6
+ isEventCatalogProEnabled: any;
7
+ isBackstagePluginEnabled: any;
8
+ }): Promise<void>;
6
9
 
7
10
  export { main as default };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-D4IJRFPJ.js";
4
- import "../chunk-NALVGTIE.js";
5
- import "../chunk-XJBJFIN7.js";
3
+ } from "../chunk-D7LV5JLL.js";
4
+ import "../chunk-I6OFOESY.js";
5
+ import "../chunk-4S3UNXH2.js";
6
6
  import "../chunk-E7TXTI7G.js";
7
7
  export {
8
8
  log_build_default as default
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.30.8";
2
+ var version = "2.31.0";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,19 +1,25 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-NALVGTIE.js";
3
+ } from "./chunk-I6OFOESY.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
7
7
  } from "./chunk-E7TXTI7G.js";
8
8
 
9
9
  // src/analytics/log-build.js
10
- var main = async (projectDir) => {
10
+ var main = async (projectDir, { isEventCatalogProEnabled, isBackstagePluginEnabled }) => {
11
11
  if (process.env.NODE_ENV === "CI") return;
12
12
  try {
13
13
  await verifyRequiredFieldsAreInCatalogConfigFile(projectDir);
14
14
  const configFile = await getEventCatalogConfigFile(projectDir);
15
15
  const { cId, organizationName, generators = [] } = configFile;
16
- const generatorNames = generators.length > 0 ? generators.map((generator) => generator[0]) : ["none"];
16
+ let generatorNames = generators.length > 0 ? generators.map((generator) => generator[0]) : ["none"];
17
+ if (isEventCatalogProEnabled) {
18
+ generatorNames.push("@eventcatalog/eventcatalog-pro");
19
+ }
20
+ if (isBackstagePluginEnabled) {
21
+ generatorNames.push("@eventcatalog/backstage-plugin-eventcatalog");
22
+ }
17
23
  await raiseEvent({
18
24
  command: "build",
19
25
  org: organizationName,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-XJBJFIN7.js";
3
+ } from "./chunk-4S3UNXH2.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -42,7 +42,50 @@ var isBackstagePluginEnabled = async (licenseKey) => {
42
42
  }
43
43
  return true;
44
44
  };
45
+ var isEventCatalogProEnabled = async (licenseKey) => {
46
+ const LICENSE_KEY = process.env.EVENTCATALOG_PRO_LICENSE_KEY || null;
47
+ if (!LICENSE_KEY) {
48
+ return false;
49
+ }
50
+ const response = await fetch("https://api.eventcatalog.cloud/functions/v1/license", {
51
+ method: "POST",
52
+ headers: {
53
+ Authorization: `Bearer ${LICENSE_KEY}`,
54
+ "Content-Type": "application/json"
55
+ }
56
+ });
57
+ if (response.status !== 200) {
58
+ console.log(
59
+ "\nTried to verify your EventCatalog Pro license but it is not valid. Please check your license key or purchase a license at https://eventcatalog.cloud/\n"
60
+ );
61
+ return false;
62
+ }
63
+ if (response.status === 200) {
64
+ const data = await response.json();
65
+ if ("@eventcatalog/eventcatalog-pro" !== data.plugin) {
66
+ console.log(
67
+ "\nInvalid license key for EventCatalog Pro, please check your license key or purchase a license at https://eventcatalog.cloud/\n"
68
+ );
69
+ return false;
70
+ }
71
+ let message = "EventCatalog Pro is enabled for EventCatalog";
72
+ if (data.is_trial) {
73
+ message += "\nYou are using a trial license for EventCatalog Pro.";
74
+ }
75
+ console.log(
76
+ boxen(message, {
77
+ padding: 1,
78
+ margin: 1,
79
+ borderColor: "green",
80
+ title: "@eventcatalog/eventcatalog-pro",
81
+ titleAlignment: "center"
82
+ })
83
+ );
84
+ }
85
+ return true;
86
+ };
45
87
 
46
88
  export {
47
- isBackstagePluginEnabled
89
+ isBackstagePluginEnabled,
90
+ isEventCatalogProEnabled
48
91
  };
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "2.30.8";
28
+ var version = "2.31.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-XJBJFIN7.js";
3
+ } from "./chunk-4S3UNXH2.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -157,7 +157,7 @@ var import_axios = __toESM(require("axios"), 1);
157
157
  var import_os = __toESM(require("os"), 1);
158
158
 
159
159
  // package.json
160
- var version = "2.30.8";
160
+ var version = "2.31.0";
161
161
 
162
162
  // src/constants.ts
163
163
  var VERSION = version;
@@ -187,13 +187,19 @@ async function raiseEvent(eventData) {
187
187
  }
188
188
 
189
189
  // src/analytics/log-build.js
190
- var main = async (projectDir) => {
190
+ var main = async (projectDir, { isEventCatalogProEnabled: isEventCatalogProEnabled2, isBackstagePluginEnabled: isBackstagePluginEnabled2 }) => {
191
191
  if (process.env.NODE_ENV === "CI") return;
192
192
  try {
193
193
  await verifyRequiredFieldsAreInCatalogConfigFile(projectDir);
194
194
  const configFile = await getEventCatalogConfigFile(projectDir);
195
195
  const { cId, organizationName, generators = [] } = configFile;
196
- const generatorNames = generators.length > 0 ? generators.map((generator) => generator[0]) : ["none"];
196
+ let generatorNames = generators.length > 0 ? generators.map((generator) => generator[0]) : ["none"];
197
+ if (isEventCatalogProEnabled2) {
198
+ generatorNames.push("@eventcatalog/eventcatalog-pro");
199
+ }
200
+ if (isBackstagePluginEnabled2) {
201
+ generatorNames.push("@eventcatalog/backstage-plugin-eventcatalog");
202
+ }
197
203
  await raiseEvent({
198
204
  command: "build",
199
205
  org: organizationName,
@@ -505,6 +511,48 @@ var isBackstagePluginEnabled = async (licenseKey) => {
505
511
  }
506
512
  return true;
507
513
  };
514
+ var isEventCatalogProEnabled = async (licenseKey) => {
515
+ const LICENSE_KEY = process.env.EVENTCATALOG_PRO_LICENSE_KEY || null;
516
+ if (!LICENSE_KEY) {
517
+ return false;
518
+ }
519
+ const response = await fetch("https://api.eventcatalog.cloud/functions/v1/license", {
520
+ method: "POST",
521
+ headers: {
522
+ Authorization: `Bearer ${LICENSE_KEY}`,
523
+ "Content-Type": "application/json"
524
+ }
525
+ });
526
+ if (response.status !== 200) {
527
+ console.log(
528
+ "\nTried to verify your EventCatalog Pro license but it is not valid. Please check your license key or purchase a license at https://eventcatalog.cloud/\n"
529
+ );
530
+ return false;
531
+ }
532
+ if (response.status === 200) {
533
+ const data = await response.json();
534
+ if ("@eventcatalog/eventcatalog-pro" !== data.plugin) {
535
+ console.log(
536
+ "\nInvalid license key for EventCatalog Pro, please check your license key or purchase a license at https://eventcatalog.cloud/\n"
537
+ );
538
+ return false;
539
+ }
540
+ let message = "EventCatalog Pro is enabled for EventCatalog";
541
+ if (data.is_trial) {
542
+ message += "\nYou are using a trial license for EventCatalog Pro.";
543
+ }
544
+ console.log(
545
+ (0, import_boxen.default)(message, {
546
+ padding: 1,
547
+ margin: 1,
548
+ borderColor: "green",
549
+ title: "@eventcatalog/eventcatalog-pro",
550
+ titleAlignment: "center"
551
+ })
552
+ );
553
+ }
554
+ return true;
555
+ };
508
556
 
509
557
  // src/eventcatalog.ts
510
558
  var import_update_notifier = __toESM(require("update-notifier"), 1);
@@ -585,6 +633,7 @@ program.command("dev").description("Run development server of EventCatalog").opt
585
633
  await checkAndConvertMdToMdx(dir, core);
586
634
  await catalogToAstro(dir, core);
587
635
  const canEmbedPages = await isBackstagePluginEnabled();
636
+ const isEventCatalogPro = await isEventCatalogProEnabled();
588
637
  checkForUpdate();
589
638
  let watchUnsub;
590
639
  try {
@@ -599,7 +648,8 @@ program.command("dev").description("Run development server of EventCatalog").opt
599
648
  env: {
600
649
  PROJECT_DIR: dir,
601
650
  CATALOG_DIR: core,
602
- ENABLE_EMBED: canEmbedPages
651
+ ENABLE_EMBED: canEmbedPages,
652
+ EVENTCATALOG_PRO: isEventCatalogPro
603
653
  }
604
654
  }
605
655
  ],
@@ -626,23 +676,31 @@ program.command("dev").description("Run development server of EventCatalog").opt
626
676
  program.command("build").description("Run build of EventCatalog").action(async (options, command) => {
627
677
  console.log("Building EventCatalog...");
628
678
  copyCore();
629
- await log_build_default(dir);
679
+ const canEmbedPages = await isBackstagePluginEnabled();
680
+ const isEventCatalogPro = await isEventCatalogProEnabled();
681
+ await log_build_default(dir, { isEventCatalogProEnabled: isEventCatalogPro, isBackstagePluginEnabled: canEmbedPages });
630
682
  await resolve_catalog_dependencies_default(dir, core);
631
683
  await checkAndConvertMdToMdx(dir, core);
632
684
  await catalogToAstro(dir, core);
633
- const canEmbedPages = await isBackstagePluginEnabled();
634
685
  checkForUpdate();
635
686
  const windowsCommand = `npx astro build ${command.args.join(" ").trim()} | findstr /V "The collection"`;
636
687
  const unixCommand = `npx astro build ${command.args.join(" ").trim()} 2>&1 | grep -v "The collection.*does not exist"`;
637
688
  const buildCommand = process.platform === "win32" ? windowsCommand : unixCommand;
638
- (0, import_node_child_process.execSync)(`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} ${buildCommand}`, {
639
- cwd: core,
640
- stdio: "inherit"
641
- });
689
+ (0, import_node_child_process.execSync)(
690
+ `cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_PRO=${isEventCatalogPro} ${buildCommand}`,
691
+ {
692
+ cwd: core,
693
+ stdio: "inherit"
694
+ }
695
+ );
642
696
  });
643
- var previewCatalog = ({ command, canEmbedPages = false }) => {
697
+ var previewCatalog = ({
698
+ command,
699
+ canEmbedPages = false,
700
+ isEventCatalogPro = false
701
+ }) => {
644
702
  (0, import_node_child_process.execSync)(
645
- `cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} npx astro preview ${command.args.join(" ").trim()}`,
703
+ `cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_PRO=${isEventCatalogPro} npx astro preview ${command.args.join(" ").trim()}`,
646
704
  {
647
705
  cwd: core,
648
706
  stdio: "inherit"
@@ -652,12 +710,14 @@ var previewCatalog = ({ command, canEmbedPages = false }) => {
652
710
  program.command("preview").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
653
711
  console.log("Starting preview of your build...");
654
712
  const canEmbedPages = await isBackstagePluginEnabled();
655
- previewCatalog({ command, canEmbedPages });
713
+ const isEventCatalogPro = await isEventCatalogProEnabled();
714
+ previewCatalog({ command, canEmbedPages, isEventCatalogPro });
656
715
  });
657
716
  program.command("start").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
658
717
  console.log("Starting preview of your build...");
659
718
  const canEmbedPages = await isBackstagePluginEnabled();
660
- previewCatalog({ command, canEmbedPages });
719
+ const isEventCatalogPro = await isEventCatalogProEnabled();
720
+ previewCatalog({ command, canEmbedPages, isEventCatalogPro });
661
721
  });
662
722
  program.command("generate [siteDir]").description("Start the generator scripts.").action(async () => {
663
723
  await generate(dir);
@@ -6,6 +6,31 @@ type ResourceDependency = {
6
6
  id: string;
7
7
  version?: string;
8
8
  };
9
+ type CustomSideBarItem = {
10
+ label: string;
11
+ slug: string;
12
+ items?: CustomSideBarItem[];
13
+ };
14
+ type ManualSideBarConfig = {
15
+ label: string;
16
+ badge?: {
17
+ text: string;
18
+ color: string;
19
+ };
20
+ collapsed?: boolean;
21
+ items: CustomSideBarItem[];
22
+ };
23
+ type AutoGeneratedSideBarConfig = {
24
+ label: string;
25
+ autogenerated: {
26
+ directory: string;
27
+ };
28
+ badge?: {
29
+ text: string;
30
+ color: string;
31
+ };
32
+ collapsed?: boolean;
33
+ };
9
34
  interface Config {
10
35
  title: string;
11
36
  tagline: false;
@@ -53,6 +78,9 @@ interface Config {
53
78
  max_tokens?: number;
54
79
  similarityResults?: number;
55
80
  };
81
+ customDocs?: {
82
+ sidebar?: (ManualSideBarConfig | AutoGeneratedSideBarConfig)[];
83
+ };
56
84
  }
57
85
 
58
86
  export type { Config, SideBarConfig };
@@ -6,6 +6,31 @@ type ResourceDependency = {
6
6
  id: string;
7
7
  version?: string;
8
8
  };
9
+ type CustomSideBarItem = {
10
+ label: string;
11
+ slug: string;
12
+ items?: CustomSideBarItem[];
13
+ };
14
+ type ManualSideBarConfig = {
15
+ label: string;
16
+ badge?: {
17
+ text: string;
18
+ color: string;
19
+ };
20
+ collapsed?: boolean;
21
+ items: CustomSideBarItem[];
22
+ };
23
+ type AutoGeneratedSideBarConfig = {
24
+ label: string;
25
+ autogenerated: {
26
+ directory: string;
27
+ };
28
+ badge?: {
29
+ text: string;
30
+ color: string;
31
+ };
32
+ collapsed?: boolean;
33
+ };
9
34
  interface Config {
10
35
  title: string;
11
36
  tagline: false;
@@ -53,6 +78,9 @@ interface Config {
53
78
  max_tokens?: number;
54
79
  similarityResults?: number;
55
80
  };
81
+ customDocs?: {
82
+ sidebar?: (ManualSideBarConfig | AutoGeneratedSideBarConfig)[];
83
+ };
56
84
  }
57
85
 
58
86
  export type { Config, SideBarConfig };
@@ -6,18 +6,19 @@ import {
6
6
  } from "./chunk-UKJ7F5WR.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-D4IJRFPJ.js";
10
- import "./chunk-NALVGTIE.js";
9
+ } from "./chunk-D7LV5JLL.js";
10
+ import "./chunk-I6OFOESY.js";
11
11
  import {
12
12
  catalogToAstro,
13
13
  checkAndConvertMdToMdx
14
14
  } from "./chunk-7SI5EVOX.js";
15
15
  import {
16
16
  VERSION
17
- } from "./chunk-XJBJFIN7.js";
17
+ } from "./chunk-4S3UNXH2.js";
18
18
  import {
19
- isBackstagePluginEnabled
20
- } from "./chunk-XMDPVKIJ.js";
19
+ isBackstagePluginEnabled,
20
+ isEventCatalogProEnabled
21
+ } from "./chunk-NJGR7XUU.js";
21
22
  import {
22
23
  generate
23
24
  } from "./chunk-YEQVKHST.js";
@@ -111,6 +112,7 @@ program.command("dev").description("Run development server of EventCatalog").opt
111
112
  await checkAndConvertMdToMdx(dir, core);
112
113
  await catalogToAstro(dir, core);
113
114
  const canEmbedPages = await isBackstagePluginEnabled();
115
+ const isEventCatalogPro = await isEventCatalogProEnabled();
114
116
  checkForUpdate();
115
117
  let watchUnsub;
116
118
  try {
@@ -125,7 +127,8 @@ program.command("dev").description("Run development server of EventCatalog").opt
125
127
  env: {
126
128
  PROJECT_DIR: dir,
127
129
  CATALOG_DIR: core,
128
- ENABLE_EMBED: canEmbedPages
130
+ ENABLE_EMBED: canEmbedPages,
131
+ EVENTCATALOG_PRO: isEventCatalogPro
129
132
  }
130
133
  }
131
134
  ],
@@ -152,23 +155,31 @@ program.command("dev").description("Run development server of EventCatalog").opt
152
155
  program.command("build").description("Run build of EventCatalog").action(async (options, command) => {
153
156
  console.log("Building EventCatalog...");
154
157
  copyCore();
155
- await log_build_default(dir);
158
+ const canEmbedPages = await isBackstagePluginEnabled();
159
+ const isEventCatalogPro = await isEventCatalogProEnabled();
160
+ await log_build_default(dir, { isEventCatalogProEnabled: isEventCatalogPro, isBackstagePluginEnabled: canEmbedPages });
156
161
  await resolve_catalog_dependencies_default(dir, core);
157
162
  await checkAndConvertMdToMdx(dir, core);
158
163
  await catalogToAstro(dir, core);
159
- const canEmbedPages = await isBackstagePluginEnabled();
160
164
  checkForUpdate();
161
165
  const windowsCommand = `npx astro build ${command.args.join(" ").trim()} | findstr /V "The collection"`;
162
166
  const unixCommand = `npx astro build ${command.args.join(" ").trim()} 2>&1 | grep -v "The collection.*does not exist"`;
163
167
  const buildCommand = process.platform === "win32" ? windowsCommand : unixCommand;
164
- execSync(`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} ${buildCommand}`, {
165
- cwd: core,
166
- stdio: "inherit"
167
- });
168
+ execSync(
169
+ `cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_PRO=${isEventCatalogPro} ${buildCommand}`,
170
+ {
171
+ cwd: core,
172
+ stdio: "inherit"
173
+ }
174
+ );
168
175
  });
169
- var previewCatalog = ({ command, canEmbedPages = false }) => {
176
+ var previewCatalog = ({
177
+ command,
178
+ canEmbedPages = false,
179
+ isEventCatalogPro = false
180
+ }) => {
170
181
  execSync(
171
- `cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} npx astro preview ${command.args.join(" ").trim()}`,
182
+ `cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_PRO=${isEventCatalogPro} npx astro preview ${command.args.join(" ").trim()}`,
172
183
  {
173
184
  cwd: core,
174
185
  stdio: "inherit"
@@ -178,12 +189,14 @@ var previewCatalog = ({ command, canEmbedPages = false }) => {
178
189
  program.command("preview").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
179
190
  console.log("Starting preview of your build...");
180
191
  const canEmbedPages = await isBackstagePluginEnabled();
181
- previewCatalog({ command, canEmbedPages });
192
+ const isEventCatalogPro = await isEventCatalogProEnabled();
193
+ previewCatalog({ command, canEmbedPages, isEventCatalogPro });
182
194
  });
183
195
  program.command("start").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
184
196
  console.log("Starting preview of your build...");
185
197
  const canEmbedPages = await isBackstagePluginEnabled();
186
- previewCatalog({ command, canEmbedPages });
198
+ const isEventCatalogPro = await isEventCatalogProEnabled();
199
+ previewCatalog({ command, canEmbedPages, isEventCatalogPro });
187
200
  });
188
201
  program.command("generate [siteDir]").description("Start the generator scripts.").action(async () => {
189
202
  await generate(dir);
package/dist/features.cjs CHANGED
@@ -30,7 +30,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/features.ts
31
31
  var features_exports = {};
32
32
  __export(features_exports, {
33
- isBackstagePluginEnabled: () => isBackstagePluginEnabled
33
+ isBackstagePluginEnabled: () => isBackstagePluginEnabled,
34
+ isEventCatalogProEnabled: () => isEventCatalogProEnabled
34
35
  });
35
36
  module.exports = __toCommonJS(features_exports);
36
37
  var import_boxen = __toESM(require("boxen"), 1);
@@ -76,7 +77,50 @@ var isBackstagePluginEnabled = async (licenseKey) => {
76
77
  }
77
78
  return true;
78
79
  };
80
+ var isEventCatalogProEnabled = async (licenseKey) => {
81
+ const LICENSE_KEY = process.env.EVENTCATALOG_PRO_LICENSE_KEY || null;
82
+ if (!LICENSE_KEY) {
83
+ return false;
84
+ }
85
+ const response = await fetch("https://api.eventcatalog.cloud/functions/v1/license", {
86
+ method: "POST",
87
+ headers: {
88
+ Authorization: `Bearer ${LICENSE_KEY}`,
89
+ "Content-Type": "application/json"
90
+ }
91
+ });
92
+ if (response.status !== 200) {
93
+ console.log(
94
+ "\nTried to verify your EventCatalog Pro license but it is not valid. Please check your license key or purchase a license at https://eventcatalog.cloud/\n"
95
+ );
96
+ return false;
97
+ }
98
+ if (response.status === 200) {
99
+ const data = await response.json();
100
+ if ("@eventcatalog/eventcatalog-pro" !== data.plugin) {
101
+ console.log(
102
+ "\nInvalid license key for EventCatalog Pro, please check your license key or purchase a license at https://eventcatalog.cloud/\n"
103
+ );
104
+ return false;
105
+ }
106
+ let message = "EventCatalog Pro is enabled for EventCatalog";
107
+ if (data.is_trial) {
108
+ message += "\nYou are using a trial license for EventCatalog Pro.";
109
+ }
110
+ console.log(
111
+ (0, import_boxen.default)(message, {
112
+ padding: 1,
113
+ margin: 1,
114
+ borderColor: "green",
115
+ title: "@eventcatalog/eventcatalog-pro",
116
+ titleAlignment: "center"
117
+ })
118
+ );
119
+ }
120
+ return true;
121
+ };
79
122
  // Annotate the CommonJS export names for ESM import in node:
80
123
  0 && (module.exports = {
81
- isBackstagePluginEnabled
124
+ isBackstagePluginEnabled,
125
+ isEventCatalogProEnabled
82
126
  });
@@ -1,3 +1,4 @@
1
1
  declare const isBackstagePluginEnabled: (licenseKey?: string) => Promise<boolean>;
2
+ declare const isEventCatalogProEnabled: (licenseKey?: string) => Promise<boolean>;
2
3
 
3
- export { isBackstagePluginEnabled };
4
+ export { isBackstagePluginEnabled, isEventCatalogProEnabled };
@@ -1,3 +1,4 @@
1
1
  declare const isBackstagePluginEnabled: (licenseKey?: string) => Promise<boolean>;
2
+ declare const isEventCatalogProEnabled: (licenseKey?: string) => Promise<boolean>;
2
3
 
3
- export { isBackstagePluginEnabled };
4
+ export { isBackstagePluginEnabled, isEventCatalogProEnabled };
package/dist/features.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import {
2
- isBackstagePluginEnabled
3
- } from "./chunk-XMDPVKIJ.js";
2
+ isBackstagePluginEnabled,
3
+ isEventCatalogProEnabled
4
+ } from "./chunk-NJGR7XUU.js";
4
5
  export {
5
- isBackstagePluginEnabled
6
+ isBackstagePluginEnabled,
7
+ isEventCatalogProEnabled
6
8
  };
@@ -38,8 +38,6 @@ function classNames(...classes: any) {
38
38
  export default function UserNode({ data, sourcePosition, targetPosition }: any) {
39
39
  const { mode, step, custom: customProps } = data as Data;
40
40
 
41
- console.log('step', customProps);
42
-
43
41
  const {
44
42
  color = 'blue',
45
43
  title = 'Custom',
@@ -2,7 +2,7 @@
2
2
  const { title } = Astro.props;
3
3
  ---
4
4
 
5
- <li class="mb-8 ml-6 w-full xl:max-w-[50%] step">
5
+ <li class="mb-8 ml-6 w-full xl:max-w-[90%] step">
6
6
  <div class="flex items-center mb-4">
7
7
  <span class="step-number absolute flex items-center justify-center w-6 h-6 bg-primary/80 rounded-md -left-3 text-white">
8
8
  <div></div>