@eventcatalog/core 4.11.2 → 4.12.0-beta.1
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 +17 -11
- package/dist/analytics/log-build.js +4 -4
- package/dist/astro-config-path.cjs +51 -0
- package/dist/astro-config-path.d.cts +6 -0
- package/dist/astro-config-path.d.ts +6 -0
- package/dist/astro-config-path.js +6 -0
- package/dist/catalog-runtime.cjs +136 -0
- package/dist/catalog-runtime.d.cts +12 -0
- package/dist/catalog-runtime.d.ts +12 -0
- package/dist/catalog-runtime.js +8 -0
- package/dist/{chunk-B7HCX5HM.js → chunk-3SJDIENM.js} +1 -1
- package/dist/{chunk-AFPH6ERZ.js → chunk-5QRWGO2E.js} +1 -1
- package/dist/{chunk-6U72KINX.js → chunk-DJCOJ77J.js} +1 -0
- package/dist/{chunk-LHR4G2UO.js → chunk-EEZXGNF6.js} +1 -1
- package/dist/{chunk-XMRPNDXB.js → chunk-ISBBAOCD.js} +1 -1
- package/dist/{chunk-Z6OKCHWL.js → chunk-IUPFEQMU.js} +2 -2
- package/dist/{chunk-6QENHZZP.js → chunk-JE6RX7SJ.js} +11 -5
- package/dist/{chunk-LAWEGSJH.js → chunk-LU4GFIHH.js} +1 -1
- package/dist/{chunk-2YJRF4ZX.js → chunk-RYPZGCRN.js} +1 -1
- package/dist/chunk-SAN4U2WU.js +96 -0
- package/dist/{chunk-EGH3ALRY.js → chunk-TVLJNFDW.js} +4 -4
- package/dist/chunk-U63GDPPY.js +14 -0
- package/dist/chunk-VIJJ7JKH.js +17 -0
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog-config-file-utils.cjs +13 -7
- package/dist/eventcatalog-config-file-utils.d.cts +86 -2
- package/dist/eventcatalog-config-file-utils.d.ts +86 -2
- package/dist/eventcatalog-config-file-utils.js +1 -1
- package/dist/eventcatalog.cjs +227 -561
- package/dist/eventcatalog.js +62 -71
- package/dist/features.cjs +10 -6
- package/dist/features.js +2 -2
- package/dist/federation/federate.cjs +110 -106
- package/dist/federation/federate.js +4 -4
- package/dist/generate.cjs +11 -7
- package/dist/generate.js +4 -4
- package/dist/resolve-catalog-dependencies.cjs +12 -8
- package/dist/resolve-catalog-dependencies.js +2 -2
- package/dist/runtime-dependencies/@ai-sdk__react.mjs +3 -0
- package/dist/runtime-dependencies/@astrojs__markdown-remark.mjs +3 -0
- package/dist/runtime-dependencies/@astrojs__mdx.mjs +3 -0
- package/dist/runtime-dependencies/@astrojs__node.mjs +3 -0
- package/dist/runtime-dependencies/@astrojs__react.mjs +3 -0
- package/dist/runtime-dependencies/@astrojs__rss.mjs +3 -0
- package/dist/runtime-dependencies/@asyncapi__avro-schema-parser.mjs +3 -0
- package/dist/runtime-dependencies/@asyncapi__parser.mjs +3 -0
- package/dist/runtime-dependencies/@asyncapi__react-component.mjs +3 -0
- package/dist/runtime-dependencies/@asyncapi__react-component__styles__default.min.css.mjs +3 -0
- package/dist/runtime-dependencies/@auth__core.mjs +3 -0
- package/dist/runtime-dependencies/@auth__core__providers__auth0.mjs +3 -0
- package/dist/runtime-dependencies/@auth__core__providers__github.mjs +3 -0
- package/dist/runtime-dependencies/@auth__core__providers__google.mjs +3 -0
- package/dist/runtime-dependencies/@auth__core__providers__microsoft-entra-id.mjs +3 -0
- package/dist/runtime-dependencies/@auth__core__providers__okta.mjs +3 -0
- package/dist/runtime-dependencies/@auth__core__types.mjs +3 -0
- package/dist/runtime-dependencies/@eventcatalog__license.mjs +3 -0
- package/dist/runtime-dependencies/@eventcatalog__linter.mjs +3 -0
- package/dist/runtime-dependencies/@eventcatalog__sdk.mjs +3 -0
- package/dist/runtime-dependencies/@eventcatalog__visualiser.mjs +3 -0
- package/dist/runtime-dependencies/@eventcatalog__visualiser__styles-core.css.mjs +3 -0
- package/dist/runtime-dependencies/@fontsource__inter.mjs +3 -0
- package/dist/runtime-dependencies/@fontsource__inter__400.css.mjs +3 -0
- package/dist/runtime-dependencies/@fontsource__inter__700.css.mjs +3 -0
- package/dist/runtime-dependencies/@headlessui__react.mjs +3 -0
- package/dist/runtime-dependencies/@heroicons__react.mjs +3 -0
- package/dist/runtime-dependencies/@heroicons__react__16__solid__EnvelopeIcon.mjs +3 -0
- package/dist/runtime-dependencies/@heroicons__react__20__solid.mjs +3 -0
- package/dist/runtime-dependencies/@heroicons__react__24__outline.mjs +3 -0
- package/dist/runtime-dependencies/@heroicons__react__24__outline__MagnifyingGlassIcon.mjs +3 -0
- package/dist/runtime-dependencies/@heroicons__react__24__outline__RectangleGroupIcon.mjs +3 -0
- package/dist/runtime-dependencies/@heroicons__react__24__outline__ServerIcon.mjs +3 -0
- package/dist/runtime-dependencies/@heroicons__react__24__solid.mjs +3 -0
- package/dist/runtime-dependencies/@iconify-json__logos.mjs +3 -0
- package/dist/runtime-dependencies/@mermaid-js__layout-elk.mjs +3 -0
- package/dist/runtime-dependencies/@mermaid-js__layout-elk__dist__mermaid-layout-elk.core.mjs.mjs +3 -0
- package/dist/runtime-dependencies/@modelcontextprotocol__sdk.mjs +3 -0
- package/dist/runtime-dependencies/@modelcontextprotocol__sdk__server__mcp.js.mjs +3 -0
- package/dist/runtime-dependencies/@modelcontextprotocol__sdk__server__webStandardStreamableHttp.js.mjs +3 -0
- package/dist/runtime-dependencies/@nanostores__react.mjs +3 -0
- package/dist/runtime-dependencies/@parcel__watcher.mjs +3 -0
- package/dist/runtime-dependencies/@radix-ui__react-context-menu.mjs +3 -0
- package/dist/runtime-dependencies/@radix-ui__react-dialog.mjs +3 -0
- package/dist/runtime-dependencies/@radix-ui__react-dropdown-menu.mjs +3 -0
- package/dist/runtime-dependencies/@radix-ui__react-popover.mjs +3 -0
- package/dist/runtime-dependencies/@radix-ui__react-tooltip.mjs +3 -0
- package/dist/runtime-dependencies/@scalar__api-reference-react.mjs +3 -0
- package/dist/runtime-dependencies/@scalar__api-reference-react__style.css.mjs +3 -0
- package/dist/runtime-dependencies/@tailwindcss__typography.mjs +3 -0
- package/dist/runtime-dependencies/@tailwindcss__vite.mjs +3 -0
- package/dist/runtime-dependencies/@tanstack__react-table.mjs +3 -0
- package/dist/runtime-dependencies/@xyflow__react.mjs +3 -0
- package/dist/runtime-dependencies/@xyflow__react__dist__style.css.mjs +3 -0
- package/dist/runtime-dependencies/ai.mjs +3 -0
- package/dist/runtime-dependencies/astro-expressive-code.mjs +3 -0
- package/dist/runtime-dependencies/astro-expressive-code__components.mjs +3 -0
- package/dist/runtime-dependencies/astro-seo.mjs +3 -0
- package/dist/runtime-dependencies/astro.mjs +3 -0
- package/dist/runtime-dependencies/astro__assets__services__sharp.mjs +3 -0
- package/dist/runtime-dependencies/astro__config.mjs +3 -0
- package/dist/runtime-dependencies/astro__jsx-runtime.mjs +3 -0
- package/dist/runtime-dependencies/astro__loaders.mjs +3 -0
- package/dist/runtime-dependencies/astro__logger__node.mjs +3 -0
- package/dist/runtime-dependencies/astro__types.mjs +3 -0
- package/dist/runtime-dependencies/astro__zod.mjs +3 -0
- package/dist/runtime-dependencies/auth-astro.mjs +3 -0
- package/dist/runtime-dependencies/auth-astro__client.mjs +3 -0
- package/dist/runtime-dependencies/auth-astro__server.mjs +3 -0
- package/dist/runtime-dependencies/boxen.mjs +3 -0
- package/dist/runtime-dependencies/commander.mjs +3 -0
- package/dist/runtime-dependencies/cross-env.mjs +3 -0
- package/dist/runtime-dependencies/d3-drag.mjs +3 -0
- package/dist/runtime-dependencies/d3-force.mjs +3 -0
- package/dist/runtime-dependencies/d3-selection.mjs +3 -0
- package/dist/runtime-dependencies/d3-zoom.mjs +3 -0
- package/dist/runtime-dependencies/dagre.mjs +3 -0
- package/dist/runtime-dependencies/diff.mjs +3 -0
- package/dist/runtime-dependencies/diff2html.mjs +3 -0
- package/dist/runtime-dependencies/diff2html__bundles__css__diff2html.min.css.mjs +3 -0
- package/dist/runtime-dependencies/dotenv.mjs +3 -0
- package/dist/runtime-dependencies/elkjs.mjs +3 -0
- package/dist/runtime-dependencies/elkjs__lib__elk.bundled.js.mjs +3 -0
- package/dist/runtime-dependencies/glob.mjs +3 -0
- package/dist/runtime-dependencies/gray-matter.mjs +3 -0
- package/dist/runtime-dependencies/hono.mjs +3 -0
- package/dist/runtime-dependencies/html-to-image.mjs +3 -0
- package/dist/runtime-dependencies/js-yaml.mjs +3 -0
- package/dist/runtime-dependencies/jsonpath-plus.mjs +3 -0
- package/dist/runtime-dependencies/jsonwebtoken.mjs +3 -0
- package/dist/runtime-dependencies/lodash.debounce.mjs +3 -0
- package/dist/runtime-dependencies/lodash.merge.mjs +3 -0
- package/dist/runtime-dependencies/lucide-react.mjs +3 -0
- package/dist/runtime-dependencies/manifest.json +136 -0
- package/dist/runtime-dependencies/marked.mjs +3 -0
- package/dist/runtime-dependencies/mdast-util-find-and-replace.mjs +3 -0
- package/dist/runtime-dependencies/mermaid.mjs +3 -0
- package/dist/runtime-dependencies/minisearch.mjs +3 -0
- package/dist/runtime-dependencies/nanostores.mjs +3 -0
- package/dist/runtime-dependencies/pagefind.mjs +3 -0
- package/dist/runtime-dependencies/pako.mjs +3 -0
- package/dist/runtime-dependencies/parse5.mjs +3 -0
- package/dist/runtime-dependencies/picocolors.mjs +3 -0
- package/dist/runtime-dependencies/picomatch.mjs +3 -0
- package/dist/runtime-dependencies/react-dom.mjs +3 -0
- package/dist/runtime-dependencies/react-dom__client.mjs +3 -0
- package/dist/runtime-dependencies/react-dom__server.mjs +3 -0
- package/dist/runtime-dependencies/react-markdown.mjs +3 -0
- package/dist/runtime-dependencies/react-syntax-highlighter.mjs +3 -0
- package/dist/runtime-dependencies/react-syntax-highlighter__dist__cjs__styles__prism.mjs +3 -0
- package/dist/runtime-dependencies/react-syntax-highlighter__dist__cjs__styles__prism__index.js.mjs +3 -0
- package/dist/runtime-dependencies/react.mjs +3 -0
- package/dist/runtime-dependencies/react__jsx-dev-runtime.mjs +3 -0
- package/dist/runtime-dependencies/react__jsx-runtime.mjs +3 -0
- package/dist/runtime-dependencies/recast.mjs +3 -0
- package/dist/runtime-dependencies/recast__parsers__babel.js.mjs +3 -0
- package/dist/runtime-dependencies/rehype-autolink-headings.mjs +3 -0
- package/dist/runtime-dependencies/rehype-expressive-code.mjs +3 -0
- package/dist/runtime-dependencies/rehype-expressive-code__hast.mjs +3 -0
- package/dist/runtime-dependencies/rehype-slug.mjs +3 -0
- package/dist/runtime-dependencies/remark-comment.mjs +3 -0
- package/dist/runtime-dependencies/remark-directive.mjs +3 -0
- package/dist/runtime-dependencies/remark-gfm.mjs +3 -0
- package/dist/runtime-dependencies/rimraf.mjs +3 -0
- package/dist/runtime-dependencies/semver.mjs +3 -0
- package/dist/runtime-dependencies/shelljs.mjs +3 -0
- package/dist/runtime-dependencies/sonner.mjs +3 -0
- package/dist/runtime-dependencies/sql.js.mjs +3 -0
- package/dist/runtime-dependencies/tailwindcss.mjs +3 -0
- package/dist/runtime-dependencies/typescript.mjs +3 -0
- package/dist/runtime-dependencies/unist-util-visit.mjs +3 -0
- package/dist/runtime-dependencies/update-notifier.mjs +3 -0
- package/dist/runtime-dependencies/uuid.mjs +3 -0
- package/dist/runtime-dependencies/zod.mjs +3 -0
- package/dist/runtime-dependencies/zod__v4.mjs +3 -0
- package/dist/search-indexer.cjs +1 -0
- package/dist/search-indexer.js +1 -1
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/dist/watcher.cjs +5 -204
- package/dist/watcher.js +1 -2
- package/eventcatalog/astro.config.mjs +57 -31
- package/eventcatalog/integrations/catalog-assets.mjs +204 -0
- package/eventcatalog/integrations/config-loader.mjs +85 -0
- package/eventcatalog/integrations/ecstudio-watcher.mjs +11 -9
- package/eventcatalog/integrations/eventcatalog-runtime.mjs +252 -0
- package/eventcatalog/integrations/expressive-code-config.mjs +6 -0
- package/eventcatalog/integrations/runtime-dependencies.mjs +49 -0
- package/eventcatalog/integrations/runtime-dependency-manifest.mjs +15 -0
- package/eventcatalog/integrations/runtime-paths.mjs +16 -0
- package/eventcatalog/src/content.config.ts +33 -46
- package/eventcatalog/src/enterprise/custom-pages/routes.ts +3 -2
- package/eventcatalog/src/enterprise/feature.ts +2 -1
- package/eventcatalog/src/enterprise/fields/field-indexer.ts +5 -2
- package/eventcatalog/src/enterprise/fields/pages/api/fields.ts +4 -3
- package/eventcatalog/src/enterprise/integrations/eventcatalog-features.ts +32 -32
- package/eventcatalog/src/enterprise/mcp/mcp-auth.ts +1 -1
- package/eventcatalog/src/env.d.ts +7 -1
- package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +15 -3
- package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/index.astro +1 -1
- package/eventcatalog/src/pages/diagrams/[id]/[version]/index.astro +2 -2
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro +2 -2
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/index.astro +2 -2
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/graphql/[filename].astro +1 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +2 -2
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/resources/index.astro +1 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/language/[dictionaryId]/index.astro +1 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/language/index.astro +1 -1
- package/eventcatalog/src/pages/docs/teams/[id]/index.astro +2 -2
- package/eventcatalog/src/pages/docs/users/[id]/index.astro +2 -2
- package/eventcatalog/src/pages/index.astro +2 -3
- package/eventcatalog/src/styles/tailwind.css +3 -0
- package/eventcatalog/src/utils/eventcatalog-config/source.ts +9 -0
- package/eventcatalog/src/utils/feature.ts +2 -1
- package/eventcatalog/tsconfig.json +1 -4
- package/package.json +17 -4
- package/dist/catalog-to-astro-content-directory.cjs +0 -382
- package/dist/catalog-to-astro-content-directory.d.cts +0 -3
- package/dist/catalog-to-astro-content-directory.d.ts +0 -3
- package/dist/catalog-to-astro-content-directory.js +0 -9
- package/dist/chunk-BWN544LB.js +0 -73
- package/dist/chunk-DHH5U5PF.js +0 -53
- package/dist/chunk-KLOHNCNF.js +0 -101
- package/dist/chunk-T4RVWPIQ.js +0 -85
- package/dist/chunk-T5IUG523.js +0 -54
- package/dist/chunk-W5JQON7Z.js +0 -117
- package/dist/copy-core.cjs +0 -88
- package/dist/copy-core.d.cts +0 -4
- package/dist/copy-core.d.ts +0 -4
- package/dist/copy-core.js +0 -8
- package/dist/core-node-modules.cjs +0 -108
- package/dist/core-node-modules.d.cts +0 -7
- package/dist/core-node-modules.d.ts +0 -7
- package/dist/core-node-modules.js +0 -8
- package/dist/custom-components.cjs +0 -89
- package/dist/custom-components.d.cts +0 -4
- package/dist/custom-components.d.ts +0 -4
- package/dist/custom-components.js +0 -8
- package/dist/map-catalog-to-astro.cjs +0 -151
- package/dist/map-catalog-to-astro.d.cts +0 -28
- package/dist/map-catalog-to-astro.d.ts +0 -28
- package/dist/map-catalog-to-astro.js +0 -6
|
@@ -35,13 +35,17 @@ __export(log_build_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(log_build_exports);
|
|
36
36
|
|
|
37
37
|
// src/eventcatalog-config-file-utils.js
|
|
38
|
+
var import_promises2 = require("fs/promises");
|
|
39
|
+
var import_node_path2 = __toESM(require("path"), 1);
|
|
40
|
+
var import_uuid = require("uuid");
|
|
41
|
+
var import_gray_matter = __toESM(require("gray-matter"), 1);
|
|
42
|
+
|
|
43
|
+
// eventcatalog/integrations/config-loader.mjs
|
|
38
44
|
var import_promises = require("fs/promises");
|
|
39
45
|
var import_node_fs = require("fs");
|
|
40
46
|
var import_node_path = __toESM(require("path"), 1);
|
|
41
|
-
var
|
|
42
|
-
var import_url = require("url");
|
|
47
|
+
var import_node_url = require("url");
|
|
43
48
|
var import_node_os = require("os");
|
|
44
|
-
var import_gray_matter = __toESM(require("gray-matter"), 1);
|
|
45
49
|
async function cleanup(projectDirectory) {
|
|
46
50
|
const filePath = import_node_path.default.join(projectDirectory, "eventcatalog.config.mjs");
|
|
47
51
|
if ((0, import_node_fs.existsSync)(filePath)) {
|
|
@@ -89,7 +93,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
|
89
93
|
configFilePath = import_node_path.default.join(tempDir, "eventcatalog.config.mjs");
|
|
90
94
|
await (0, import_promises.copyFile)(import_node_path.default.join(projectDirectory, "eventcatalog.config.js"), configFilePath);
|
|
91
95
|
}
|
|
92
|
-
const configFileURL = `${(0,
|
|
96
|
+
const configFileURL = `${(0, import_node_url.pathToFileURL)(configFilePath).href}?t=${Date.now()}`;
|
|
93
97
|
const config = await import(
|
|
94
98
|
/* @vite-ignore */
|
|
95
99
|
configFileURL
|
|
@@ -102,10 +106,12 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
|
102
106
|
}
|
|
103
107
|
}
|
|
104
108
|
};
|
|
109
|
+
|
|
110
|
+
// src/eventcatalog-config-file-utils.js
|
|
105
111
|
var writeEventCatalogConfigFile = async (projectDirectory, newConfig) => {
|
|
106
112
|
try {
|
|
107
|
-
const configFilePath =
|
|
108
|
-
let content = await (0,
|
|
113
|
+
const configFilePath = import_node_path2.default.join(projectDirectory, "eventcatalog.config.js");
|
|
114
|
+
let content = await (0, import_promises2.readFile)(configFilePath, "utf8");
|
|
109
115
|
const startIndex = content.indexOf("export default {");
|
|
110
116
|
if (startIndex === -1) {
|
|
111
117
|
return;
|
|
@@ -121,7 +127,7 @@ var writeEventCatalogConfigFile = async (projectDirectory, newConfig) => {
|
|
|
121
127
|
${key}: ${valueString},` + content.slice(insertPosition);
|
|
122
128
|
}
|
|
123
129
|
});
|
|
124
|
-
await (0,
|
|
130
|
+
await (0, import_promises2.writeFile)(configFilePath, content);
|
|
125
131
|
} finally {
|
|
126
132
|
await cleanup(projectDirectory);
|
|
127
133
|
}
|
|
@@ -140,7 +146,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
140
146
|
var import_os = __toESM(require("os"), 1);
|
|
141
147
|
|
|
142
148
|
// package.json
|
|
143
|
-
var version = "4.
|
|
149
|
+
var version = "4.12.0-beta.1";
|
|
144
150
|
|
|
145
151
|
// src/constants.ts
|
|
146
152
|
var VERSION = version;
|
|
@@ -179,8 +185,8 @@ async function raiseEvent(eventData) {
|
|
|
179
185
|
// src/analytics/count-resources.js
|
|
180
186
|
var import_glob = require("glob");
|
|
181
187
|
var import_node_crypto = require("crypto");
|
|
182
|
-
var
|
|
183
|
-
var
|
|
188
|
+
var import_promises3 = require("fs/promises");
|
|
189
|
+
var import_node_path3 = __toESM(require("path"), 1);
|
|
184
190
|
var RESOURCE_PATTERNS = {
|
|
185
191
|
adrs: ["**/adrs/*/index.@(md|mdx)"],
|
|
186
192
|
agents: ["**/agents/*/index.@(md|mdx)"],
|
|
@@ -232,7 +238,7 @@ async function hashCatalogContent(projectDir) {
|
|
|
232
238
|
for (const file of [...files].sort()) {
|
|
233
239
|
try {
|
|
234
240
|
hash.update(file);
|
|
235
|
-
hash.update(await (0,
|
|
241
|
+
hash.update(await (0, import_promises3.readFile)(import_node_path3.default.join(projectDir, file)));
|
|
236
242
|
} catch {
|
|
237
243
|
}
|
|
238
244
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-AFPH6ERZ.js";
|
|
3
|
+
} from "../chunk-TVLJNFDW.js";
|
|
5
4
|
import "../chunk-ZAZHAVKB.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-5QRWGO2E.js";
|
|
6
|
+
import "../chunk-LU4GFIHH.js";
|
|
7
|
+
import "../chunk-JE6RX7SJ.js";
|
|
8
8
|
export {
|
|
9
9
|
log_build_default as default
|
|
10
10
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
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/astro-config-path.ts
|
|
31
|
+
var astro_config_path_exports = {};
|
|
32
|
+
__export(astro_config_path_exports, {
|
|
33
|
+
getAstroConfigPath: () => getAstroConfigPath
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(astro_config_path_exports);
|
|
36
|
+
var import_node_path = __toESM(require("path"), 1);
|
|
37
|
+
var getAstroConfigPath = (projectDirectory, configFile, paths = import_node_path.default) => {
|
|
38
|
+
const relative = paths.relative(projectDirectory, configFile);
|
|
39
|
+
const projectRoot = paths.parse(paths.resolve(projectDirectory)).root.toLowerCase();
|
|
40
|
+
const configRoot = paths.parse(paths.resolve(configFile)).root.toLowerCase();
|
|
41
|
+
if (projectRoot !== configRoot || paths.isAbsolute(relative)) {
|
|
42
|
+
throw new Error(
|
|
43
|
+
"EventCatalog cannot load its Astro configuration across filesystem drives. Install or link @eventcatalog/core on the same drive as the catalog."
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
return relative.replace(/\\/g, "/");
|
|
47
|
+
};
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
getAstroConfigPath
|
|
51
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
|
|
3
|
+
/** Astro's CLI resolves --config relative to its project root, including on Windows. */
|
|
4
|
+
declare const getAstroConfigPath: (projectDirectory: string, configFile: string, paths?: path.PlatformPath) => string;
|
|
5
|
+
|
|
6
|
+
export { getAstroConfigPath };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
|
|
3
|
+
/** Astro's CLI resolves --config relative to its project root, including on Windows. */
|
|
4
|
+
declare const getAstroConfigPath: (projectDirectory: string, configFile: string, paths?: path.PlatformPath) => string;
|
|
5
|
+
|
|
6
|
+
export { getAstroConfigPath };
|
|
@@ -0,0 +1,136 @@
|
|
|
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/catalog-runtime.ts
|
|
31
|
+
var catalog_runtime_exports = {};
|
|
32
|
+
__export(catalog_runtime_exports, {
|
|
33
|
+
clearCatalogCache: () => clearCatalogCache,
|
|
34
|
+
prepareCatalogRuntime: () => prepareCatalogRuntime
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(catalog_runtime_exports);
|
|
37
|
+
|
|
38
|
+
// ../../node_modules/.pnpm/tsup@8.5.0_jiti@2.7.0_postcss@8.5.15_tsx@4.21.0_typescript@5.9.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js
|
|
39
|
+
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
40
|
+
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
41
|
+
|
|
42
|
+
// src/catalog-runtime.ts
|
|
43
|
+
var import_node_fs = __toESM(require("fs"), 1);
|
|
44
|
+
var import_node_path2 = __toESM(require("path"), 1);
|
|
45
|
+
var import_node_module = require("module");
|
|
46
|
+
|
|
47
|
+
// eventcatalog/integrations/runtime-paths.mjs
|
|
48
|
+
var import_node_path = __toESM(require("path"), 1);
|
|
49
|
+
function getRuntimePaths(projectDirectory, runtimeDirectory) {
|
|
50
|
+
const project = import_node_path.default.resolve(projectDirectory);
|
|
51
|
+
const cacheDirectory = import_node_path.default.join(project, ".astro");
|
|
52
|
+
const runtime = runtimeDirectory ? import_node_path.default.resolve(runtimeDirectory) : import_node_path.default.join(cacheDirectory, "eventcatalog");
|
|
53
|
+
return {
|
|
54
|
+
projectDirectory: project,
|
|
55
|
+
cacheDirectory,
|
|
56
|
+
runtimeDirectory: runtime,
|
|
57
|
+
fieldsDatabasePath: import_node_path.default.join(runtime, ".eventcatalog", "fields.db")
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// src/catalog-runtime.ts
|
|
62
|
+
var require2 = (0, import_node_module.createRequire)(importMetaUrl);
|
|
63
|
+
var writeIfChanged = (file, content) => {
|
|
64
|
+
if (import_node_fs.default.existsSync(file) && import_node_fs.default.readFileSync(file, "utf8") === content) return;
|
|
65
|
+
import_node_fs.default.mkdirSync(import_node_path2.default.dirname(file), { recursive: true });
|
|
66
|
+
import_node_fs.default.writeFileSync(file, content);
|
|
67
|
+
};
|
|
68
|
+
var importPath = (file) => file.replace(/\\/g, "/");
|
|
69
|
+
var clearCatalogCache = (projectDirectory) => {
|
|
70
|
+
const { cacheDirectory } = getRuntimePaths(projectDirectory);
|
|
71
|
+
import_node_fs.default.rmSync(cacheDirectory, { recursive: true, force: true });
|
|
72
|
+
};
|
|
73
|
+
var prepareCatalogRuntime = ({ projectDirectory, catalogDirectory, packageDirectory }) => {
|
|
74
|
+
const runtime = import_node_path2.default.resolve(catalogDirectory);
|
|
75
|
+
const source = import_node_path2.default.resolve(packageDirectory);
|
|
76
|
+
const project = import_node_path2.default.resolve(projectDirectory);
|
|
77
|
+
if (runtime === source || runtime === project) {
|
|
78
|
+
throw new Error("The catalog runtime must be separate from the project and installed application directories.");
|
|
79
|
+
}
|
|
80
|
+
import_node_fs.default.mkdirSync(runtime, { recursive: true });
|
|
81
|
+
writeIfChanged(
|
|
82
|
+
import_node_path2.default.join(runtime, "content.config.ts"),
|
|
83
|
+
`export { collections } from ${JSON.stringify(importPath(import_node_path2.default.join(source, "src/content.config.ts")))};
|
|
84
|
+
`
|
|
85
|
+
);
|
|
86
|
+
const packageTsconfig = JSON.parse(import_node_fs.default.readFileSync(import_node_path2.default.join(source, "tsconfig.json"), "utf8"));
|
|
87
|
+
const paths = Object.fromEntries(
|
|
88
|
+
Object.entries(packageTsconfig.compilerOptions.paths).map(([alias, targets]) => [
|
|
89
|
+
alias,
|
|
90
|
+
targets.map((target) => importPath(import_node_path2.default.resolve(source, target)))
|
|
91
|
+
])
|
|
92
|
+
);
|
|
93
|
+
paths["@config"] = [importPath(import_node_path2.default.join(project, "eventcatalog.config.js"))];
|
|
94
|
+
paths["@catalog/styles"] = [importPath(import_node_path2.default.join(project, "eventcatalog.styles.css"))];
|
|
95
|
+
paths["@catalog/components/*"] = [
|
|
96
|
+
importPath(import_node_path2.default.join(project, "components/*")),
|
|
97
|
+
importPath(import_node_path2.default.join(project, "federated/components/*"))
|
|
98
|
+
];
|
|
99
|
+
paths["@catalog/snippets/*"] = [importPath(import_node_path2.default.join(project, "snippets/*"))];
|
|
100
|
+
for (const specifier of ["astro", "astro/zod", "astro/loaders", "astro/runtime/server/index.js"]) {
|
|
101
|
+
paths[specifier] = [importPath(require2.resolve(specifier).replace(/\.js$/, ".d.ts"))];
|
|
102
|
+
}
|
|
103
|
+
writeIfChanged(
|
|
104
|
+
import_node_path2.default.join(runtime, "tsconfig.json"),
|
|
105
|
+
JSON.stringify(
|
|
106
|
+
{
|
|
107
|
+
extends: importPath(import_node_path2.default.join(source, "tsconfig.json")),
|
|
108
|
+
compilerOptions: {
|
|
109
|
+
baseUrl: ".",
|
|
110
|
+
paths,
|
|
111
|
+
typeRoots: [
|
|
112
|
+
importPath(import_node_path2.default.join(project, "node_modules/@types")),
|
|
113
|
+
importPath(import_node_path2.default.join(source, "../node_modules/@types")),
|
|
114
|
+
importPath(import_node_path2.default.join(source, "../node_modules")),
|
|
115
|
+
importPath(import_node_path2.default.join(project, "node_modules"))
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
include: [
|
|
119
|
+
importPath(import_node_path2.default.join(project, ".astro/types.d.ts")),
|
|
120
|
+
"content.config.ts",
|
|
121
|
+
importPath(import_node_path2.default.join(project, "components/**/*")),
|
|
122
|
+
importPath(import_node_path2.default.join(source, "src/**/*"))
|
|
123
|
+
],
|
|
124
|
+
// Keep legacy generated files out of checks on an existing checkout.
|
|
125
|
+
exclude: (packageTsconfig.exclude ?? []).map((entry) => importPath(import_node_path2.default.resolve(source, entry)))
|
|
126
|
+
},
|
|
127
|
+
null,
|
|
128
|
+
2
|
|
129
|
+
) + "\n"
|
|
130
|
+
);
|
|
131
|
+
};
|
|
132
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
133
|
+
0 && (module.exports = {
|
|
134
|
+
clearCatalogCache,
|
|
135
|
+
prepareCatalogRuntime
|
|
136
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type RuntimeOptions = {
|
|
2
|
+
projectDirectory: string;
|
|
3
|
+
catalogDirectory: string;
|
|
4
|
+
/** The installed package's eventcatalog/ directory. */
|
|
5
|
+
packageDirectory: string;
|
|
6
|
+
};
|
|
7
|
+
/** Clear all generated Astro state, not just EventCatalog's bootstrap files. */
|
|
8
|
+
declare const clearCatalogCache: (projectDirectory: string) => void;
|
|
9
|
+
/** Generate only collection/type metadata inside Astro's cache. */
|
|
10
|
+
declare const prepareCatalogRuntime: ({ projectDirectory, catalogDirectory, packageDirectory }: RuntimeOptions) => void;
|
|
11
|
+
|
|
12
|
+
export { clearCatalogCache, prepareCatalogRuntime };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type RuntimeOptions = {
|
|
2
|
+
projectDirectory: string;
|
|
3
|
+
catalogDirectory: string;
|
|
4
|
+
/** The installed package's eventcatalog/ directory. */
|
|
5
|
+
packageDirectory: string;
|
|
6
|
+
};
|
|
7
|
+
/** Clear all generated Astro state, not just EventCatalog's bootstrap files. */
|
|
8
|
+
declare const clearCatalogCache: (projectDirectory: string) => void;
|
|
9
|
+
/** Generate only collection/type metadata inside Astro's cache. */
|
|
10
|
+
declare const prepareCatalogRuntime: ({ projectDirectory, catalogDirectory, packageDirectory }: RuntimeOptions) => void;
|
|
11
|
+
|
|
12
|
+
export { clearCatalogCache, prepareCatalogRuntime };
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
// src/eventcatalog-config-file-utils.js
|
|
2
|
-
import { readFile
|
|
2
|
+
import { readFile as readFile2, writeFile } from "fs/promises";
|
|
3
|
+
import path2 from "path";
|
|
4
|
+
import { v4 as uuidV4 } from "uuid";
|
|
5
|
+
import matter from "gray-matter";
|
|
6
|
+
|
|
7
|
+
// eventcatalog/integrations/config-loader.mjs
|
|
8
|
+
import { readFile, rm, copyFile, mkdtemp, symlink } from "fs/promises";
|
|
3
9
|
import { existsSync } from "fs";
|
|
4
10
|
import path from "path";
|
|
5
|
-
import { v4 as uuidV4 } from "uuid";
|
|
6
11
|
import { pathToFileURL } from "url";
|
|
7
12
|
import { tmpdir } from "os";
|
|
8
|
-
import matter from "gray-matter";
|
|
9
13
|
async function cleanup(projectDirectory) {
|
|
10
14
|
const filePath = path.join(projectDirectory, "eventcatalog.config.mjs");
|
|
11
15
|
if (existsSync(filePath)) {
|
|
@@ -66,10 +70,12 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
|
66
70
|
}
|
|
67
71
|
}
|
|
68
72
|
};
|
|
73
|
+
|
|
74
|
+
// src/eventcatalog-config-file-utils.js
|
|
69
75
|
var writeEventCatalogConfigFile = async (projectDirectory, newConfig) => {
|
|
70
76
|
try {
|
|
71
|
-
const configFilePath =
|
|
72
|
-
let content = await
|
|
77
|
+
const configFilePath = path2.join(projectDirectory, "eventcatalog.config.js");
|
|
78
|
+
let content = await readFile2(configFilePath, "utf8");
|
|
73
79
|
const startIndex = content.indexOf("export default {");
|
|
74
80
|
if (startIndex === -1) {
|
|
75
81
|
return;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// src/catalog-runtime.ts
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path2 from "path";
|
|
4
|
+
import { createRequire } from "module";
|
|
5
|
+
|
|
6
|
+
// eventcatalog/integrations/runtime-paths.mjs
|
|
7
|
+
import path from "path";
|
|
8
|
+
function getRuntimePaths(projectDirectory, runtimeDirectory) {
|
|
9
|
+
const project = path.resolve(projectDirectory);
|
|
10
|
+
const cacheDirectory = path.join(project, ".astro");
|
|
11
|
+
const runtime = runtimeDirectory ? path.resolve(runtimeDirectory) : path.join(cacheDirectory, "eventcatalog");
|
|
12
|
+
return {
|
|
13
|
+
projectDirectory: project,
|
|
14
|
+
cacheDirectory,
|
|
15
|
+
runtimeDirectory: runtime,
|
|
16
|
+
fieldsDatabasePath: path.join(runtime, ".eventcatalog", "fields.db")
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// src/catalog-runtime.ts
|
|
21
|
+
var require2 = createRequire(import.meta.url);
|
|
22
|
+
var writeIfChanged = (file, content) => {
|
|
23
|
+
if (fs.existsSync(file) && fs.readFileSync(file, "utf8") === content) return;
|
|
24
|
+
fs.mkdirSync(path2.dirname(file), { recursive: true });
|
|
25
|
+
fs.writeFileSync(file, content);
|
|
26
|
+
};
|
|
27
|
+
var importPath = (file) => file.replace(/\\/g, "/");
|
|
28
|
+
var clearCatalogCache = (projectDirectory) => {
|
|
29
|
+
const { cacheDirectory } = getRuntimePaths(projectDirectory);
|
|
30
|
+
fs.rmSync(cacheDirectory, { recursive: true, force: true });
|
|
31
|
+
};
|
|
32
|
+
var prepareCatalogRuntime = ({ projectDirectory, catalogDirectory, packageDirectory }) => {
|
|
33
|
+
const runtime = path2.resolve(catalogDirectory);
|
|
34
|
+
const source = path2.resolve(packageDirectory);
|
|
35
|
+
const project = path2.resolve(projectDirectory);
|
|
36
|
+
if (runtime === source || runtime === project) {
|
|
37
|
+
throw new Error("The catalog runtime must be separate from the project and installed application directories.");
|
|
38
|
+
}
|
|
39
|
+
fs.mkdirSync(runtime, { recursive: true });
|
|
40
|
+
writeIfChanged(
|
|
41
|
+
path2.join(runtime, "content.config.ts"),
|
|
42
|
+
`export { collections } from ${JSON.stringify(importPath(path2.join(source, "src/content.config.ts")))};
|
|
43
|
+
`
|
|
44
|
+
);
|
|
45
|
+
const packageTsconfig = JSON.parse(fs.readFileSync(path2.join(source, "tsconfig.json"), "utf8"));
|
|
46
|
+
const paths = Object.fromEntries(
|
|
47
|
+
Object.entries(packageTsconfig.compilerOptions.paths).map(([alias, targets]) => [
|
|
48
|
+
alias,
|
|
49
|
+
targets.map((target) => importPath(path2.resolve(source, target)))
|
|
50
|
+
])
|
|
51
|
+
);
|
|
52
|
+
paths["@config"] = [importPath(path2.join(project, "eventcatalog.config.js"))];
|
|
53
|
+
paths["@catalog/styles"] = [importPath(path2.join(project, "eventcatalog.styles.css"))];
|
|
54
|
+
paths["@catalog/components/*"] = [
|
|
55
|
+
importPath(path2.join(project, "components/*")),
|
|
56
|
+
importPath(path2.join(project, "federated/components/*"))
|
|
57
|
+
];
|
|
58
|
+
paths["@catalog/snippets/*"] = [importPath(path2.join(project, "snippets/*"))];
|
|
59
|
+
for (const specifier of ["astro", "astro/zod", "astro/loaders", "astro/runtime/server/index.js"]) {
|
|
60
|
+
paths[specifier] = [importPath(require2.resolve(specifier).replace(/\.js$/, ".d.ts"))];
|
|
61
|
+
}
|
|
62
|
+
writeIfChanged(
|
|
63
|
+
path2.join(runtime, "tsconfig.json"),
|
|
64
|
+
JSON.stringify(
|
|
65
|
+
{
|
|
66
|
+
extends: importPath(path2.join(source, "tsconfig.json")),
|
|
67
|
+
compilerOptions: {
|
|
68
|
+
baseUrl: ".",
|
|
69
|
+
paths,
|
|
70
|
+
typeRoots: [
|
|
71
|
+
importPath(path2.join(project, "node_modules/@types")),
|
|
72
|
+
importPath(path2.join(source, "../node_modules/@types")),
|
|
73
|
+
importPath(path2.join(source, "../node_modules")),
|
|
74
|
+
importPath(path2.join(project, "node_modules"))
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
include: [
|
|
78
|
+
importPath(path2.join(project, ".astro/types.d.ts")),
|
|
79
|
+
"content.config.ts",
|
|
80
|
+
importPath(path2.join(project, "components/**/*")),
|
|
81
|
+
importPath(path2.join(source, "src/**/*"))
|
|
82
|
+
],
|
|
83
|
+
// Keep legacy generated files out of checks on an existing checkout.
|
|
84
|
+
exclude: (packageTsconfig.exclude ?? []).map((entry) => importPath(path2.resolve(source, entry)))
|
|
85
|
+
},
|
|
86
|
+
null,
|
|
87
|
+
2
|
|
88
|
+
) + "\n"
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export {
|
|
93
|
+
getRuntimePaths,
|
|
94
|
+
clearCatalogCache,
|
|
95
|
+
prepareCatalogRuntime
|
|
96
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
raiseEvent
|
|
3
|
-
} from "./chunk-AFPH6ERZ.js";
|
|
4
1
|
import {
|
|
5
2
|
countResources,
|
|
6
3
|
hashCatalogContent,
|
|
7
4
|
serializeCounts
|
|
8
5
|
} from "./chunk-ZAZHAVKB.js";
|
|
6
|
+
import {
|
|
7
|
+
raiseEvent
|
|
8
|
+
} from "./chunk-5QRWGO2E.js";
|
|
9
9
|
import {
|
|
10
10
|
getEventCatalogConfigFile,
|
|
11
11
|
verifyRequiredFieldsAreInCatalogConfigFile
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JE6RX7SJ.js";
|
|
13
13
|
|
|
14
14
|
// src/analytics/log-build.js
|
|
15
15
|
var getFeatures = async (configFile) => {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/watcher.js
|
|
2
|
+
import watcher from "@parcel/watcher";
|
|
3
|
+
var toPosixPath = (p) => p.replace(/\\/g, "/");
|
|
4
|
+
async function watch(projectDirectory, catalogDirectory, callback = () => {
|
|
5
|
+
}) {
|
|
6
|
+
const subscription = await watcher.subscribe(projectDirectory, callback, {
|
|
7
|
+
ignore: [`**/${toPosixPath(catalogDirectory)}/!(${toPosixPath(projectDirectory)})**`]
|
|
8
|
+
});
|
|
9
|
+
return () => subscription.unsubscribe();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
watch
|
|
14
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/astro-config-path.ts
|
|
2
|
+
import path from "path";
|
|
3
|
+
var getAstroConfigPath = (projectDirectory, configFile, paths = path) => {
|
|
4
|
+
const relative = paths.relative(projectDirectory, configFile);
|
|
5
|
+
const projectRoot = paths.parse(paths.resolve(projectDirectory)).root.toLowerCase();
|
|
6
|
+
const configRoot = paths.parse(paths.resolve(configFile)).root.toLowerCase();
|
|
7
|
+
if (projectRoot !== configRoot || paths.isAbsolute(relative)) {
|
|
8
|
+
throw new Error(
|
|
9
|
+
"EventCatalog cannot load its Astro configuration across filesystem drives. Install or link @eventcatalog/core on the same drive as the catalog."
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
return relative.replace(/\\/g, "/");
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
getAstroConfigPath
|
|
17
|
+
};
|
package/dist/constants.cjs
CHANGED