@eventcatalog/core 2.30.7 → 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.
- package/README.md +3 -2
- package/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +9 -3
- package/dist/analytics/log-build.d.cts +4 -1
- package/dist/analytics/log-build.d.ts +4 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-SUJLBNZK.js → chunk-4S3UNXH2.js} +1 -1
- package/dist/{chunk-HINNLTBH.js → chunk-D7LV5JLL.js} +9 -3
- package/dist/{chunk-EFSBN3ZZ.js → chunk-I6OFOESY.js} +1 -1
- package/dist/{chunk-XMDPVKIJ.js → chunk-NJGR7XUU.js} +44 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +74 -14
- package/dist/eventcatalog.config.d.cts +28 -0
- package/dist/eventcatalog.config.d.ts +28 -0
- package/dist/eventcatalog.js +29 -16
- package/dist/features.cjs +46 -2
- package/dist/features.d.cts +2 -1
- package/dist/features.d.ts +2 -1
- package/dist/features.js +5 -3
- package/eventcatalog/public/images/custom-docs-placeholder.png +0 -0
- package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Custom.tsx +0 -2
- package/eventcatalog/src/components/MDX/Steps/Step.astro +1 -1
- package/eventcatalog/src/components/MDX/Steps/Steps.astro +15 -0
- package/eventcatalog/src/components/SideBars/FlowSideBar.astro +75 -0
- package/eventcatalog/src/components/SideNav/CustomDocsNav/CustomDocsNavWrapper.tsx +11 -0
- package/eventcatalog/src/components/SideNav/CustomDocsNav/components/NestedItem.tsx +183 -0
- package/eventcatalog/src/components/SideNav/CustomDocsNav/components/NoResultsFound.tsx +21 -0
- package/eventcatalog/src/components/SideNav/CustomDocsNav/index.tsx +250 -0
- package/eventcatalog/src/components/SideNav/CustomDocsNav/types.ts +29 -0
- package/eventcatalog/src/components/SideNav/CustomDocsNav.astro +9 -0
- package/eventcatalog/src/components/SideNav/TreeView/getTreeView.ts +2 -2
- package/eventcatalog/src/content.config.ts +15 -24
- package/eventcatalog/src/enterprise/collections/custom-pages.ts +19 -0
- package/eventcatalog/src/enterprise/custom-documentation/collection.ts +16 -0
- package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/CustomDocsNavWrapper.tsx +11 -0
- package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/components/NestedItem.tsx +183 -0
- package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/components/NoResultsFound.tsx +21 -0
- package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/index.tsx +250 -0
- package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/types.ts +29 -0
- package/eventcatalog/src/enterprise/custom-documentation/pages/index.astro +389 -0
- package/eventcatalog/src/enterprise/custom-documentation/utils/custom-docs.ts +118 -0
- package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +58 -9
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/asyncapi/index.astro +23 -3
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/changelog/index.astro +13 -3
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +134 -17
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/spec/index.astro +21 -3
- package/eventcatalog/src/pages/docs/[type]/[id]/language/[dictionaryId]/index.astro +1 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/language.astro +1 -1
- package/eventcatalog/src/pages/docs/custom/[...path]/index.astro +260 -0
- package/eventcatalog/src/pages/docs/teams/[id]/index.astro +5 -3
- package/eventcatalog/src/pages/docs/users/[id]/index.astro +9 -4
- package/eventcatalog/src/pages/pro/index.astro +272 -0
- package/eventcatalog/src/shared-collections.ts +25 -0
- package/eventcatalog/src/types/index.ts +1 -1
- package/eventcatalog/src/utils/eventcatalog-config/catalog.ts +12 -1
- package/eventcatalog/src/utils/feature.ts +5 -0
- package/eventcatalog/src/utils/page-loaders/page-data-loader.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
<h4>Features: Documentation for Event Driven Architectures, Integration with any broker, Generator from your OpenAPI and AsyncAPI documents, Docs and Code, Markdown driven, Document Domains/Services/Messages/Schemas and more, Content versioning, Assign Owners, Schemas, OpenAPI, MDX Components and more...</h4>
|
|
35
35
|
|
|
36
36
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
37
|
-
[](#contributors-)
|
|
38
38
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
39
39
|
|
|
40
40
|
[Read the Docs](https://www.eventcatalog.dev/docs/development/getting-started/introduction) | [View Demo](https://demo.eventcatalog.dev)
|
|
@@ -262,6 +262,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
262
262
|
<tr>
|
|
263
263
|
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/ruudwelling/"><img src="https://avatars.githubusercontent.com/u/4014179?v=4?s=100" width="100px;" alt="Ruud Welling"/><br /><sub><b>Ruud Welling</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=WellingR" title="Code">💻</a></td>
|
|
264
264
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/vienin"><img src="https://avatars.githubusercontent.com/u/2124283?v=4?s=100" width="100px;" alt="Kevin Pouget"/><br /><sub><b>Kevin Pouget</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=vienin" title="Code">💻</a></td>
|
|
265
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/VitaliiBalash"><img src="https://avatars.githubusercontent.com/u/4520809?v=4?s=100" width="100px;" alt="Vitalii Balash"/><br /><sub><b>Vitalii Balash</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=VitaliiBalash" title="Code">💻</a></td>
|
|
265
266
|
</tr>
|
|
266
267
|
</tbody>
|
|
267
268
|
</table>
|
|
@@ -275,4 +276,4 @@ This project follows the [all-contributors](https://github.com/all-contributors/
|
|
|
275
276
|
|
|
276
277
|
# License
|
|
277
278
|
|
|
278
|
-
MIT
|
|
279
|
+
MIT
|
|
@@ -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.
|
|
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
|
-
|
|
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
|
|
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
|
|
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-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
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,19 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
raiseEvent
|
|
3
|
-
} from "./chunk-
|
|
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
|
-
|
|
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,
|
|
@@ -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
|
};
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -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.
|
|
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
|
-
|
|
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
|
|
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)(
|
|
639
|
-
|
|
640
|
-
|
|
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 = ({
|
|
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
|
-
|
|
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
|
-
|
|
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 };
|
package/dist/eventcatalog.js
CHANGED
|
@@ -6,18 +6,19 @@ import {
|
|
|
6
6
|
} from "./chunk-UKJ7F5WR.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
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-
|
|
17
|
+
} from "./chunk-4S3UNXH2.js";
|
|
18
18
|
import {
|
|
19
|
-
isBackstagePluginEnabled
|
|
20
|
-
|
|
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
|
|
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(
|
|
165
|
-
|
|
166
|
-
|
|
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 = ({
|
|
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
|
-
|
|
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
|
-
|
|
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
|
});
|
package/dist/features.d.cts
CHANGED
|
@@ -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.d.ts
CHANGED
|
@@ -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
|
Binary file
|