@eventcatalog/core 5.0.2 → 5.1.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/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/architecture-export.cjs +69 -0
- package/dist/architecture-export.d.cts +48 -0
- package/dist/architecture-export.d.ts +48 -0
- package/dist/architecture-export.js +12 -0
- package/dist/chunk-E6WTCJUL.js +32 -0
- package/dist/{chunk-A7AVNA6M.js → chunk-FHZXZWCY.js} +1 -1
- package/dist/{chunk-AI5SK4WP.js → chunk-G3CHTDAE.js} +3 -3
- package/dist/{chunk-MSRXEI5A.js → chunk-OT57IOWN.js} +1 -1
- package/dist/{chunk-OX6TSVHY.js → chunk-QJ7KKN2D.js} +1 -1
- package/dist/{chunk-QS6PIAHG.js → chunk-TBXLUIJD.js} +1 -1
- package/dist/{chunk-D73WCJQD.js → chunk-WBUSFEBH.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +182 -133
- package/dist/eventcatalog.config.d.cts +12 -0
- package/dist/eventcatalog.config.d.ts +12 -0
- package/dist/eventcatalog.js +40 -12
- package/dist/federation/federate.js +3 -3
- package/dist/federation/source-provider.js +2 -2
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/runtime-dependencies/@eventcatalog__exporters.mjs +3 -0
- package/dist/runtime-dependencies/manifest.json +1 -0
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/package.json +4 -3
- package/dist/{chunk-6K7XZAYI.js → chunk-A2RZR3U4.js} +3 -3
|
@@ -169,7 +169,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
169
169
|
var import_os = __toESM(require("os"), 1);
|
|
170
170
|
|
|
171
171
|
// package.json
|
|
172
|
-
var version = "5.0
|
|
172
|
+
var version = "5.1.0";
|
|
173
173
|
|
|
174
174
|
// src/constants.ts
|
|
175
175
|
var VERSION = version;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-G3CHTDAE.js";
|
|
4
4
|
import "../chunk-AD7CL772.js";
|
|
5
|
+
import "../chunk-FHZXZWCY.js";
|
|
5
6
|
import "../chunk-ZAZHAVKB.js";
|
|
6
7
|
import "../chunk-CA6WCQ2T.js";
|
|
7
|
-
import "../chunk-A7AVNA6M.js";
|
|
8
8
|
import "../chunk-CPW6G62V.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-OT57IOWN.js";
|
|
10
10
|
import "../chunk-4G7FSRPN.js";
|
|
11
11
|
export {
|
|
12
12
|
log_build_default as default
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/architecture-export.ts
|
|
31
|
+
var architecture_export_exports = {};
|
|
32
|
+
__export(architecture_export_exports, {
|
|
33
|
+
getArchitectureExportPath: () => getArchitectureExportPath,
|
|
34
|
+
isCatalogAuthEnabled: () => isCatalogAuthEnabled,
|
|
35
|
+
resolveArchitectureExport: () => resolveArchitectureExport,
|
|
36
|
+
writeArchitectureExport: () => writeArchitectureExport
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(architecture_export_exports);
|
|
39
|
+
var import_node_fs = __toESM(require("fs"), 1);
|
|
40
|
+
var import_node_path = __toESM(require("path"), 1);
|
|
41
|
+
var import_exporters = require("@eventcatalog/exporters");
|
|
42
|
+
var isCatalogAuthEnabled = ({
|
|
43
|
+
config,
|
|
44
|
+
projectDir,
|
|
45
|
+
isServer
|
|
46
|
+
}) => Boolean(config?.auth?.enabled) && isServer && import_node_fs.default.existsSync(import_node_path.default.join(projectDir, "eventcatalog.auth.js"));
|
|
47
|
+
var resolveArchitectureExport = (config, { authEnabled }) => {
|
|
48
|
+
const enabled = config?.exports?.html?.enabled;
|
|
49
|
+
if (enabled === false) return { enabled: false, reason: "disabled" };
|
|
50
|
+
if (authEnabled && enabled !== true) return { enabled: false, reason: "auth" };
|
|
51
|
+
return { enabled: true };
|
|
52
|
+
};
|
|
53
|
+
var getArchitectureExportPath = ({ outDir, isServer }) => import_node_path.default.join(outDir, isServer ? "client" : "", "architecture.html");
|
|
54
|
+
var writeArchitectureExport = ({
|
|
55
|
+
projectDir,
|
|
56
|
+
outDir,
|
|
57
|
+
isServer
|
|
58
|
+
}) => (0, import_exporters.writeHtml)({
|
|
59
|
+
dir: projectDir,
|
|
60
|
+
outputPath: getArchitectureExportPath({ outDir, isServer }),
|
|
61
|
+
regenerateCommand: "npx eventcatalog build"
|
|
62
|
+
});
|
|
63
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
+
0 && (module.exports = {
|
|
65
|
+
getArchitectureExportPath,
|
|
66
|
+
isCatalogAuthEnabled,
|
|
67
|
+
resolveArchitectureExport,
|
|
68
|
+
writeArchitectureExport
|
|
69
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as _eventcatalog_exporters from '@eventcatalog/exporters';
|
|
2
|
+
|
|
3
|
+
/** The part of eventcatalog.config.js that controls the architecture reference. */
|
|
4
|
+
interface ArchitectureExportConfig {
|
|
5
|
+
exports?: {
|
|
6
|
+
html?: {
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Auth is on only when it is configured, the auth file exists and the catalog runs as a server, the same rule the
|
|
13
|
+
* catalog uses at runtime. New catalogs ship a commented-out eventcatalog.auth.js, so the file alone means nothing.
|
|
14
|
+
*/
|
|
15
|
+
declare const isCatalogAuthEnabled: ({ config, projectDir, isServer, }: {
|
|
16
|
+
config: {
|
|
17
|
+
auth?: {
|
|
18
|
+
enabled?: boolean;
|
|
19
|
+
};
|
|
20
|
+
} | null | undefined;
|
|
21
|
+
projectDir: string;
|
|
22
|
+
isServer: boolean;
|
|
23
|
+
}) => boolean;
|
|
24
|
+
type ArchitectureExportDecision = {
|
|
25
|
+
enabled: true;
|
|
26
|
+
} | {
|
|
27
|
+
enabled: false;
|
|
28
|
+
reason: 'disabled' | 'auth';
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* The architecture reference is written on every build unless the catalog turns it off. Catalogs with auth only
|
|
32
|
+
* get it when they opt in: build output is served as static files, outside the auth middleware.
|
|
33
|
+
*/
|
|
34
|
+
declare const resolveArchitectureExport: (config: ArchitectureExportConfig | null | undefined, { authEnabled }: {
|
|
35
|
+
authEnabled: boolean;
|
|
36
|
+
}) => ArchitectureExportDecision;
|
|
37
|
+
/** Server builds serve static files from the client folder; static builds from the output folder itself. */
|
|
38
|
+
declare const getArchitectureExportPath: ({ outDir, isServer }: {
|
|
39
|
+
outDir: string;
|
|
40
|
+
isServer: boolean;
|
|
41
|
+
}) => string;
|
|
42
|
+
declare const writeArchitectureExport: ({ projectDir, outDir, isServer, }: {
|
|
43
|
+
projectDir: string;
|
|
44
|
+
outDir: string;
|
|
45
|
+
isServer: boolean;
|
|
46
|
+
}) => Promise<_eventcatalog_exporters.WriteHtmlResult>;
|
|
47
|
+
|
|
48
|
+
export { type ArchitectureExportConfig, type ArchitectureExportDecision, getArchitectureExportPath, isCatalogAuthEnabled, resolveArchitectureExport, writeArchitectureExport };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as _eventcatalog_exporters from '@eventcatalog/exporters';
|
|
2
|
+
|
|
3
|
+
/** The part of eventcatalog.config.js that controls the architecture reference. */
|
|
4
|
+
interface ArchitectureExportConfig {
|
|
5
|
+
exports?: {
|
|
6
|
+
html?: {
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Auth is on only when it is configured, the auth file exists and the catalog runs as a server, the same rule the
|
|
13
|
+
* catalog uses at runtime. New catalogs ship a commented-out eventcatalog.auth.js, so the file alone means nothing.
|
|
14
|
+
*/
|
|
15
|
+
declare const isCatalogAuthEnabled: ({ config, projectDir, isServer, }: {
|
|
16
|
+
config: {
|
|
17
|
+
auth?: {
|
|
18
|
+
enabled?: boolean;
|
|
19
|
+
};
|
|
20
|
+
} | null | undefined;
|
|
21
|
+
projectDir: string;
|
|
22
|
+
isServer: boolean;
|
|
23
|
+
}) => boolean;
|
|
24
|
+
type ArchitectureExportDecision = {
|
|
25
|
+
enabled: true;
|
|
26
|
+
} | {
|
|
27
|
+
enabled: false;
|
|
28
|
+
reason: 'disabled' | 'auth';
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* The architecture reference is written on every build unless the catalog turns it off. Catalogs with auth only
|
|
32
|
+
* get it when they opt in: build output is served as static files, outside the auth middleware.
|
|
33
|
+
*/
|
|
34
|
+
declare const resolveArchitectureExport: (config: ArchitectureExportConfig | null | undefined, { authEnabled }: {
|
|
35
|
+
authEnabled: boolean;
|
|
36
|
+
}) => ArchitectureExportDecision;
|
|
37
|
+
/** Server builds serve static files from the client folder; static builds from the output folder itself. */
|
|
38
|
+
declare const getArchitectureExportPath: ({ outDir, isServer }: {
|
|
39
|
+
outDir: string;
|
|
40
|
+
isServer: boolean;
|
|
41
|
+
}) => string;
|
|
42
|
+
declare const writeArchitectureExport: ({ projectDir, outDir, isServer, }: {
|
|
43
|
+
projectDir: string;
|
|
44
|
+
outDir: string;
|
|
45
|
+
isServer: boolean;
|
|
46
|
+
}) => Promise<_eventcatalog_exporters.WriteHtmlResult>;
|
|
47
|
+
|
|
48
|
+
export { type ArchitectureExportConfig, type ArchitectureExportDecision, getArchitectureExportPath, isCatalogAuthEnabled, resolveArchitectureExport, writeArchitectureExport };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getArchitectureExportPath,
|
|
3
|
+
isCatalogAuthEnabled,
|
|
4
|
+
resolveArchitectureExport,
|
|
5
|
+
writeArchitectureExport
|
|
6
|
+
} from "./chunk-E6WTCJUL.js";
|
|
7
|
+
export {
|
|
8
|
+
getArchitectureExportPath,
|
|
9
|
+
isCatalogAuthEnabled,
|
|
10
|
+
resolveArchitectureExport,
|
|
11
|
+
writeArchitectureExport
|
|
12
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// src/architecture-export.ts
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { writeHtml } from "@eventcatalog/exporters";
|
|
5
|
+
var isCatalogAuthEnabled = ({
|
|
6
|
+
config,
|
|
7
|
+
projectDir,
|
|
8
|
+
isServer
|
|
9
|
+
}) => Boolean(config?.auth?.enabled) && isServer && fs.existsSync(path.join(projectDir, "eventcatalog.auth.js"));
|
|
10
|
+
var resolveArchitectureExport = (config, { authEnabled }) => {
|
|
11
|
+
const enabled = config?.exports?.html?.enabled;
|
|
12
|
+
if (enabled === false) return { enabled: false, reason: "disabled" };
|
|
13
|
+
if (authEnabled && enabled !== true) return { enabled: false, reason: "auth" };
|
|
14
|
+
return { enabled: true };
|
|
15
|
+
};
|
|
16
|
+
var getArchitectureExportPath = ({ outDir, isServer }) => path.join(outDir, isServer ? "client" : "", "architecture.html");
|
|
17
|
+
var writeArchitectureExport = ({
|
|
18
|
+
projectDir,
|
|
19
|
+
outDir,
|
|
20
|
+
isServer
|
|
21
|
+
}) => writeHtml({
|
|
22
|
+
dir: projectDir,
|
|
23
|
+
outputPath: getArchitectureExportPath({ outDir, isServer }),
|
|
24
|
+
regenerateCommand: "npx eventcatalog build"
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
isCatalogAuthEnabled,
|
|
29
|
+
resolveArchitectureExport,
|
|
30
|
+
getArchitectureExportPath,
|
|
31
|
+
writeArchitectureExport
|
|
32
|
+
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getLicenseAnalytics
|
|
3
3
|
} from "./chunk-AD7CL772.js";
|
|
4
|
+
import {
|
|
5
|
+
raiseEvent
|
|
6
|
+
} from "./chunk-FHZXZWCY.js";
|
|
4
7
|
import {
|
|
5
8
|
countResources,
|
|
6
9
|
hashCatalogContent,
|
|
@@ -11,9 +14,6 @@ import {
|
|
|
11
14
|
getStudioMode,
|
|
12
15
|
serializeStudioUsage
|
|
13
16
|
} from "./chunk-CA6WCQ2T.js";
|
|
14
|
-
import {
|
|
15
|
-
raiseEvent
|
|
16
|
-
} from "./chunk-A7AVNA6M.js";
|
|
17
17
|
import {
|
|
18
18
|
TELEMETRY_REQUEST_TIMEOUT_MS,
|
|
19
19
|
isTelemetryDisabled
|
package/dist/constants.cjs
CHANGED