@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
package/dist/chunk-T4RVWPIQ.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
mapCatalogToAstro
|
|
3
|
-
} from "./chunk-W5JQON7Z.js";
|
|
4
|
-
import {
|
|
5
|
-
isCustomComponentPath,
|
|
6
|
-
syncCustomComponents
|
|
7
|
-
} from "./chunk-T5IUG523.js";
|
|
8
|
-
import {
|
|
9
|
-
verifyRequiredFieldsAreInCatalogConfigFile
|
|
10
|
-
} from "./chunk-6QENHZZP.js";
|
|
11
|
-
|
|
12
|
-
// src/catalog-to-astro-content-directory.js
|
|
13
|
-
import { glob } from "glob";
|
|
14
|
-
import * as path from "path";
|
|
15
|
-
import fs from "fs";
|
|
16
|
-
import { fileURLToPath } from "url";
|
|
17
|
-
import os from "os";
|
|
18
|
-
var __filename = fileURLToPath(import.meta.url);
|
|
19
|
-
var rootPkg = path.resolve(path.dirname(__filename), "../");
|
|
20
|
-
var copyFiles = async (source, target) => {
|
|
21
|
-
const files = await glob(path.join(source, "**"), {
|
|
22
|
-
nodir: true,
|
|
23
|
-
windowsPathsNoEscape: os.platform() == "win32",
|
|
24
|
-
ignore: ["node_modules/**", "**/dist/**", "**/teams", "**/users", "**/*.mdx", "**/*.md", "**/package.json", "**/Dockerfile"]
|
|
25
|
-
});
|
|
26
|
-
const snippets = await glob(path.join(source, "snippets/**/*.mdx"), {
|
|
27
|
-
nodir: true,
|
|
28
|
-
windowsPathsNoEscape: os.platform() == "win32"
|
|
29
|
-
});
|
|
30
|
-
if (snippets.length > 0) {
|
|
31
|
-
files.push(...snippets);
|
|
32
|
-
}
|
|
33
|
-
if (fs.existsSync(path.join(source, ".env"))) {
|
|
34
|
-
files.push(path.join(source, ".env"));
|
|
35
|
-
}
|
|
36
|
-
for (const file of files) {
|
|
37
|
-
if (isCustomComponentPath(source, file)) continue;
|
|
38
|
-
mapCatalogToAstro({
|
|
39
|
-
filePath: file,
|
|
40
|
-
astroDir: target,
|
|
41
|
-
projectDir: source
|
|
42
|
-
}).map((astroPath) => {
|
|
43
|
-
fs.cpSync(file, astroPath);
|
|
44
|
-
return { oldPath: file, newPath: astroPath };
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var clearCustomPages = async (target) => {
|
|
49
|
-
const customPagesDir = path.join(target, "src", "custom-pages");
|
|
50
|
-
if (fs.existsSync(customPagesDir)) fs.rmSync(customPagesDir, { recursive: true });
|
|
51
|
-
const staleCodeFiles = await glob(path.join(target, "public", "generated", "pages", "**/*.{astro,ts,js,mjs}"), {
|
|
52
|
-
nodir: true,
|
|
53
|
-
windowsPathsNoEscape: os.platform() == "win32"
|
|
54
|
-
});
|
|
55
|
-
for (const file of staleCodeFiles) {
|
|
56
|
-
fs.rmSync(file);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
var removeGeneratedLikeC4Sources = async (target) => {
|
|
60
|
-
const generatedDir = path.join(target, "public", "generated");
|
|
61
|
-
const files = await glob(path.join(generatedDir, "**/*.{c4,likec4}"), {
|
|
62
|
-
nodir: true,
|
|
63
|
-
windowsPathsNoEscape: os.platform() == "win32"
|
|
64
|
-
});
|
|
65
|
-
for (const file of files) {
|
|
66
|
-
fs.rmSync(file);
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
var catalogToAstro = async (source, astroDir) => {
|
|
70
|
-
const astroContentDir = path.join(astroDir, "src/content/");
|
|
71
|
-
if (fs.existsSync(astroContentDir)) fs.rmSync(astroContentDir, { recursive: true });
|
|
72
|
-
fs.mkdirSync(astroContentDir);
|
|
73
|
-
await verifyRequiredFieldsAreInCatalogConfigFile(source);
|
|
74
|
-
if (!fs.existsSync(path.join(source, "eventcatalog.styles.css"))) {
|
|
75
|
-
fs.writeFileSync(path.join(source, "eventcatalog.styles.css"), "");
|
|
76
|
-
}
|
|
77
|
-
await clearCustomPages(astroDir);
|
|
78
|
-
await removeGeneratedLikeC4Sources(astroDir);
|
|
79
|
-
await syncCustomComponents(source, astroDir);
|
|
80
|
-
await copyFiles(source, astroDir);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export {
|
|
84
|
-
catalogToAstro
|
|
85
|
-
};
|
package/dist/chunk-T5IUG523.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// src/custom-components.js
|
|
2
|
-
import fs from "fs/promises";
|
|
3
|
-
import path from "path";
|
|
4
|
-
var isCustomComponentPath = (projectDirectory, filePath) => {
|
|
5
|
-
const [rootDirectory, childDirectory] = path.relative(projectDirectory, filePath).split(path.sep);
|
|
6
|
-
return rootDirectory === "components" || rootDirectory === "federated" && childDirectory === "components";
|
|
7
|
-
};
|
|
8
|
-
var readDirectory = async (directory) => {
|
|
9
|
-
try {
|
|
10
|
-
return await fs.readdir(directory, { withFileTypes: true });
|
|
11
|
-
} catch (error) {
|
|
12
|
-
if (error.code === "ENOENT") return [];
|
|
13
|
-
throw error;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
var mergeDirectory = async (sourceDirectory, destinationDirectory) => {
|
|
17
|
-
for (const entry of await readDirectory(sourceDirectory)) {
|
|
18
|
-
const sourcePath = path.join(sourceDirectory, entry.name);
|
|
19
|
-
const destinationPath = path.join(destinationDirectory, entry.name);
|
|
20
|
-
if (entry.isDirectory()) {
|
|
21
|
-
const destinationEntry = await fs.stat(destinationPath).catch((error) => {
|
|
22
|
-
if (error.code === "ENOENT") return void 0;
|
|
23
|
-
throw error;
|
|
24
|
-
});
|
|
25
|
-
if (destinationEntry && !destinationEntry.isDirectory()) {
|
|
26
|
-
await fs.rm(destinationPath, { recursive: true, force: true });
|
|
27
|
-
}
|
|
28
|
-
await fs.mkdir(destinationPath, { recursive: true });
|
|
29
|
-
await mergeDirectory(sourcePath, destinationPath);
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
await fs.rm(destinationPath, { recursive: true, force: true });
|
|
33
|
-
await fs.copyFile(sourcePath, destinationPath);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
var syncCustomComponents = async (projectDirectory, catalogDirectory) => {
|
|
37
|
-
const destinationDirectory = path.join(catalogDirectory, "src", "custom-defined-components");
|
|
38
|
-
const destinationParent = path.dirname(destinationDirectory);
|
|
39
|
-
await fs.mkdir(destinationParent, { recursive: true });
|
|
40
|
-
const stagingDirectory = await fs.mkdtemp(path.join(destinationParent, ".custom-defined-components.staging-"));
|
|
41
|
-
try {
|
|
42
|
-
await mergeDirectory(path.join(projectDirectory, "federated", "components"), stagingDirectory);
|
|
43
|
-
await mergeDirectory(path.join(projectDirectory, "components"), stagingDirectory);
|
|
44
|
-
await fs.rm(destinationDirectory, { recursive: true, force: true });
|
|
45
|
-
await fs.rename(stagingDirectory, destinationDirectory);
|
|
46
|
-
} finally {
|
|
47
|
-
await fs.rm(stagingDirectory, { recursive: true, force: true });
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export {
|
|
52
|
-
isCustomComponentPath,
|
|
53
|
-
syncCustomComponents
|
|
54
|
-
};
|
package/dist/chunk-W5JQON7Z.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
// src/map-catalog-to-astro.js
|
|
2
|
-
import path from "path";
|
|
3
|
-
var CUSTOM_PAGE_EXTENSIONS = [".astro", ".ts", ".js", ".mjs"];
|
|
4
|
-
var COLLECTION_KEYS = [
|
|
5
|
-
"agents",
|
|
6
|
-
"events",
|
|
7
|
-
"commands",
|
|
8
|
-
"services",
|
|
9
|
-
"domains",
|
|
10
|
-
"flows",
|
|
11
|
-
"pages",
|
|
12
|
-
"changelogs",
|
|
13
|
-
"queries",
|
|
14
|
-
"channels",
|
|
15
|
-
"ubiquitousLanguages",
|
|
16
|
-
"dependencies"
|
|
17
|
-
];
|
|
18
|
-
function mapCatalogToAstro({ filePath, astroDir, projectDir }) {
|
|
19
|
-
const relativeFilePath = removeBasePath(filePath, projectDir);
|
|
20
|
-
if (isLikeC4Source(relativeFilePath)) {
|
|
21
|
-
return [];
|
|
22
|
-
}
|
|
23
|
-
if (!isCatalogRelated(relativeFilePath)) {
|
|
24
|
-
return [];
|
|
25
|
-
}
|
|
26
|
-
const customPageTargetPaths = getCustomPageTargetPaths(relativeFilePath, astroDir);
|
|
27
|
-
if (customPageTargetPaths) {
|
|
28
|
-
return customPageTargetPaths;
|
|
29
|
-
}
|
|
30
|
-
const baseTargetPaths = getBaseTargetPaths(relativeFilePath);
|
|
31
|
-
const relativeTargetPath = getRelativeTargetPath(relativeFilePath);
|
|
32
|
-
return baseTargetPaths.map((base) => path.join(astroDir, base, relativeTargetPath));
|
|
33
|
-
}
|
|
34
|
-
function removeBasePath(fullPath, basePath) {
|
|
35
|
-
const relativePath = path.relative(basePath, fullPath);
|
|
36
|
-
return relativePath.startsWith("..") ? fullPath : relativePath;
|
|
37
|
-
}
|
|
38
|
-
function isCollectionKey(key) {
|
|
39
|
-
return COLLECTION_KEYS.includes(key);
|
|
40
|
-
}
|
|
41
|
-
function isLikeC4Source(filePath) {
|
|
42
|
-
return filePath.endsWith(".c4") || filePath.endsWith(".likec4");
|
|
43
|
-
}
|
|
44
|
-
var hasExtension = (str) => /\.[a-zA-Z0-9]{2,}$/.test(str);
|
|
45
|
-
function getCustomPageTargetPaths(filePath, astroDir) {
|
|
46
|
-
const filePathArr = filePath.split(path.sep).filter(Boolean);
|
|
47
|
-
if (filePathArr[0] !== "pages") {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
const customPagePath = path.join(astroDir, "src", "custom-pages", ...filePathArr.slice(1));
|
|
51
|
-
if (CUSTOM_PAGE_EXTENSIONS.includes(path.extname(filePath).toLowerCase())) {
|
|
52
|
-
return [customPagePath];
|
|
53
|
-
}
|
|
54
|
-
if (!hasExtension(filePath)) {
|
|
55
|
-
return [customPagePath, path.join(astroDir, "public", "generated", ...filePathArr)];
|
|
56
|
-
}
|
|
57
|
-
return [path.join(astroDir, "public", "generated", ...filePathArr)];
|
|
58
|
-
}
|
|
59
|
-
function isCatalogRelated(filePath) {
|
|
60
|
-
const filePathArr = filePath.split(path.sep).filter(Boolean);
|
|
61
|
-
if ([
|
|
62
|
-
"eventcatalog.config.js",
|
|
63
|
-
// config file at root
|
|
64
|
-
"eventcatalog.styles.css",
|
|
65
|
-
// custom styles file at root
|
|
66
|
-
"components",
|
|
67
|
-
// custom components
|
|
68
|
-
"snippets",
|
|
69
|
-
// custom snippets
|
|
70
|
-
"public",
|
|
71
|
-
// public assets
|
|
72
|
-
".env",
|
|
73
|
-
// env file
|
|
74
|
-
...COLLECTION_KEYS
|
|
75
|
-
].includes(filePathArr[0])) {
|
|
76
|
-
return true;
|
|
77
|
-
}
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
function getBaseTargetPaths(filePath) {
|
|
81
|
-
const filePathArr = filePath.split(path.sep).filter(Boolean);
|
|
82
|
-
if (isCollectionKey(filePathArr[0])) {
|
|
83
|
-
if (hasExtension(filePath)) {
|
|
84
|
-
return [path.join("public", "generated")];
|
|
85
|
-
}
|
|
86
|
-
return [path.join("public", "generated")];
|
|
87
|
-
}
|
|
88
|
-
if (filePathArr[0] == "components") {
|
|
89
|
-
return [path.join("src", "custom-defined-components")];
|
|
90
|
-
}
|
|
91
|
-
if (filePathArr[0] == "snippets") {
|
|
92
|
-
return [path.join("src")];
|
|
93
|
-
}
|
|
94
|
-
if (filePathArr[0] == "public") {
|
|
95
|
-
return [path.join("public")];
|
|
96
|
-
}
|
|
97
|
-
return [path.join("/")];
|
|
98
|
-
}
|
|
99
|
-
function getRelativeTargetPath(filePath) {
|
|
100
|
-
const filePathArr = filePath.split(path.sep).filter(Boolean);
|
|
101
|
-
if (filePathArr[0] == "public" || filePathArr[0] == "components") {
|
|
102
|
-
filePathArr.shift();
|
|
103
|
-
}
|
|
104
|
-
if (filePathArr[0] == "snippets") {
|
|
105
|
-
return path.join("snippets", ...filePathArr.slice(1));
|
|
106
|
-
}
|
|
107
|
-
const relativePath = [];
|
|
108
|
-
for (let i = filePathArr.length - 1; i >= 0; i--) {
|
|
109
|
-
relativePath.unshift(filePathArr[i]);
|
|
110
|
-
if (isCollectionKey(filePathArr[i]) && filePathArr[i] != "snippets") break;
|
|
111
|
-
}
|
|
112
|
-
return path.join(...relativePath);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export {
|
|
116
|
-
mapCatalogToAstro
|
|
117
|
-
};
|
package/dist/copy-core.cjs
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
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/copy-core.ts
|
|
31
|
-
var copy_core_exports = {};
|
|
32
|
-
__export(copy_core_exports, {
|
|
33
|
-
pruneExcludedCoreEntries: () => pruneExcludedCoreEntries,
|
|
34
|
-
shouldCopyCoreEntry: () => shouldCopyCoreEntry
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(copy_core_exports);
|
|
37
|
-
var import_node_fs = __toESM(require("fs"), 1);
|
|
38
|
-
var import_node_path = __toESM(require("path"), 1);
|
|
39
|
-
var IGNORED_CORE_DIRECTORIES = /* @__PURE__ */ new Set([".astro", "dist", "node_modules", "__tests__"]);
|
|
40
|
-
var COLOCATED_TEST_SUFFIXES = [
|
|
41
|
-
".spec.js",
|
|
42
|
-
".spec.jsx",
|
|
43
|
-
".spec.cjs",
|
|
44
|
-
".spec.mjs",
|
|
45
|
-
".spec.ts",
|
|
46
|
-
".spec.tsx",
|
|
47
|
-
".spec.cts",
|
|
48
|
-
".spec.mts",
|
|
49
|
-
".test.js",
|
|
50
|
-
".test.jsx",
|
|
51
|
-
".test.cjs",
|
|
52
|
-
".test.mjs",
|
|
53
|
-
".test.ts",
|
|
54
|
-
".test.tsx",
|
|
55
|
-
".test.cts",
|
|
56
|
-
".test.mts"
|
|
57
|
-
];
|
|
58
|
-
var isColocatedTestFile = (fileName) => COLOCATED_TEST_SUFFIXES.some((suffix) => fileName.endsWith(suffix));
|
|
59
|
-
var shouldCopyCoreEntry = (sourceRoot, sourcePath) => {
|
|
60
|
-
const relativePath = import_node_path.default.relative(sourceRoot, sourcePath);
|
|
61
|
-
if (relativePath === "") return true;
|
|
62
|
-
const pathParts = relativePath.split(import_node_path.default.sep);
|
|
63
|
-
if (pathParts.some((part) => IGNORED_CORE_DIRECTORIES.has(part))) return false;
|
|
64
|
-
const fileName = pathParts[pathParts.length - 1] ?? "";
|
|
65
|
-
return !isColocatedTestFile(fileName);
|
|
66
|
-
};
|
|
67
|
-
var PRUNE_SKIPPED_DIRECTORIES = /* @__PURE__ */ new Set([".astro", "dist", "node_modules"]);
|
|
68
|
-
var pruneExcludedCoreEntries = (coreDir) => {
|
|
69
|
-
if (!import_node_fs.default.existsSync(coreDir)) return;
|
|
70
|
-
const visit = (directory) => {
|
|
71
|
-
for (const entry of import_node_fs.default.readdirSync(directory, { withFileTypes: true })) {
|
|
72
|
-
const entryPath = import_node_path.default.join(directory, entry.name);
|
|
73
|
-
if (entry.name === "__tests__" || isColocatedTestFile(entry.name)) {
|
|
74
|
-
import_node_fs.default.rmSync(entryPath, { recursive: true, force: true });
|
|
75
|
-
continue;
|
|
76
|
-
}
|
|
77
|
-
if (entry.isDirectory() && !PRUNE_SKIPPED_DIRECTORIES.has(entry.name)) {
|
|
78
|
-
visit(entryPath);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
visit(coreDir);
|
|
83
|
-
};
|
|
84
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
85
|
-
0 && (module.exports = {
|
|
86
|
-
pruneExcludedCoreEntries,
|
|
87
|
-
shouldCopyCoreEntry
|
|
88
|
-
});
|
package/dist/copy-core.d.cts
DELETED
package/dist/copy-core.d.ts
DELETED
package/dist/copy-core.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
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/core-node-modules.ts
|
|
31
|
-
var core_node_modules_exports = {};
|
|
32
|
-
__export(core_node_modules_exports, {
|
|
33
|
-
linkCoreNodeModules: () => linkCoreNodeModules,
|
|
34
|
-
resolveInstalledCoreNodeModules: () => resolveInstalledCoreNodeModules
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(core_node_modules_exports);
|
|
37
|
-
var import_fs = __toESM(require("fs"), 1);
|
|
38
|
-
var import_node_path = __toESM(require("path"), 1);
|
|
39
|
-
var isDirectory = (directory) => {
|
|
40
|
-
try {
|
|
41
|
-
return import_fs.default.statSync(directory).isDirectory();
|
|
42
|
-
} catch (error) {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
var hasAstroDependency = (nodeModulesDirectory) => {
|
|
47
|
-
const astroBin = process.platform === "win32" ? "astro.cmd" : "astro";
|
|
48
|
-
return import_fs.default.existsSync(import_node_path.default.join(nodeModulesDirectory, "astro", "package.json")) || import_fs.default.existsSync(import_node_path.default.join(nodeModulesDirectory, ".bin", astroBin));
|
|
49
|
-
};
|
|
50
|
-
var isSymbolicLink = (targetPath) => {
|
|
51
|
-
try {
|
|
52
|
-
return import_fs.default.lstatSync(targetPath).isSymbolicLink();
|
|
53
|
-
} catch (error) {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
var isSameDirectory = (a, b) => {
|
|
58
|
-
try {
|
|
59
|
-
return import_fs.default.realpathSync.native(a) === import_fs.default.realpathSync.native(b);
|
|
60
|
-
} catch (error) {
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
var resolveInstalledCoreNodeModules = (currentDir) => {
|
|
65
|
-
const candidates = [];
|
|
66
|
-
const seen = /* @__PURE__ */ new Set();
|
|
67
|
-
const addCandidate = (candidate) => {
|
|
68
|
-
const resolvedCandidate = import_node_path.default.resolve(candidate);
|
|
69
|
-
if (!seen.has(resolvedCandidate)) {
|
|
70
|
-
candidates.push(resolvedCandidate);
|
|
71
|
-
seen.add(resolvedCandidate);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
addCandidate(import_node_path.default.resolve(currentDir, "..", "node_modules"));
|
|
75
|
-
let directory = import_node_path.default.resolve(currentDir);
|
|
76
|
-
while (true) {
|
|
77
|
-
if (import_node_path.default.basename(directory) === "node_modules") {
|
|
78
|
-
addCandidate(directory);
|
|
79
|
-
}
|
|
80
|
-
addCandidate(import_node_path.default.join(directory, "node_modules"));
|
|
81
|
-
const parentDirectory = import_node_path.default.dirname(directory);
|
|
82
|
-
if (parentDirectory === directory) {
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
directory = parentDirectory;
|
|
86
|
-
}
|
|
87
|
-
return candidates.find((candidate) => isDirectory(candidate) && hasAstroDependency(candidate)) ?? candidates.find(isDirectory);
|
|
88
|
-
};
|
|
89
|
-
var linkCoreNodeModules = ({
|
|
90
|
-
coreNodeModules,
|
|
91
|
-
installedCoreNodeModules
|
|
92
|
-
}) => {
|
|
93
|
-
if (!installedCoreNodeModules) return;
|
|
94
|
-
if (isSymbolicLink(coreNodeModules)) {
|
|
95
|
-
if (isSameDirectory(coreNodeModules, installedCoreNodeModules)) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
import_fs.default.unlinkSync(coreNodeModules);
|
|
99
|
-
} else if (import_fs.default.existsSync(coreNodeModules)) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
import_fs.default.symlinkSync(installedCoreNodeModules, coreNodeModules, process.platform === "win32" ? "junction" : "dir");
|
|
103
|
-
};
|
|
104
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
105
|
-
0 && (module.exports = {
|
|
106
|
-
linkCoreNodeModules,
|
|
107
|
-
resolveInstalledCoreNodeModules
|
|
108
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare const resolveInstalledCoreNodeModules: (currentDir: string) => string | undefined;
|
|
2
|
-
declare const linkCoreNodeModules: ({ coreNodeModules, installedCoreNodeModules, }: {
|
|
3
|
-
coreNodeModules: string;
|
|
4
|
-
installedCoreNodeModules?: string;
|
|
5
|
-
}) => void;
|
|
6
|
-
|
|
7
|
-
export { linkCoreNodeModules, resolveInstalledCoreNodeModules };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare const resolveInstalledCoreNodeModules: (currentDir: string) => string | undefined;
|
|
2
|
-
declare const linkCoreNodeModules: ({ coreNodeModules, installedCoreNodeModules, }: {
|
|
3
|
-
coreNodeModules: string;
|
|
4
|
-
installedCoreNodeModules?: string;
|
|
5
|
-
}) => void;
|
|
6
|
-
|
|
7
|
-
export { linkCoreNodeModules, resolveInstalledCoreNodeModules };
|
|
@@ -1,89 +0,0 @@
|
|
|
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/custom-components.js
|
|
31
|
-
var custom_components_exports = {};
|
|
32
|
-
__export(custom_components_exports, {
|
|
33
|
-
isCustomComponentPath: () => isCustomComponentPath,
|
|
34
|
-
syncCustomComponents: () => syncCustomComponents
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(custom_components_exports);
|
|
37
|
-
var import_promises = __toESM(require("fs/promises"), 1);
|
|
38
|
-
var import_node_path = __toESM(require("path"), 1);
|
|
39
|
-
var isCustomComponentPath = (projectDirectory, filePath) => {
|
|
40
|
-
const [rootDirectory, childDirectory] = import_node_path.default.relative(projectDirectory, filePath).split(import_node_path.default.sep);
|
|
41
|
-
return rootDirectory === "components" || rootDirectory === "federated" && childDirectory === "components";
|
|
42
|
-
};
|
|
43
|
-
var readDirectory = async (directory) => {
|
|
44
|
-
try {
|
|
45
|
-
return await import_promises.default.readdir(directory, { withFileTypes: true });
|
|
46
|
-
} catch (error) {
|
|
47
|
-
if (error.code === "ENOENT") return [];
|
|
48
|
-
throw error;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
var mergeDirectory = async (sourceDirectory, destinationDirectory) => {
|
|
52
|
-
for (const entry of await readDirectory(sourceDirectory)) {
|
|
53
|
-
const sourcePath = import_node_path.default.join(sourceDirectory, entry.name);
|
|
54
|
-
const destinationPath = import_node_path.default.join(destinationDirectory, entry.name);
|
|
55
|
-
if (entry.isDirectory()) {
|
|
56
|
-
const destinationEntry = await import_promises.default.stat(destinationPath).catch((error) => {
|
|
57
|
-
if (error.code === "ENOENT") return void 0;
|
|
58
|
-
throw error;
|
|
59
|
-
});
|
|
60
|
-
if (destinationEntry && !destinationEntry.isDirectory()) {
|
|
61
|
-
await import_promises.default.rm(destinationPath, { recursive: true, force: true });
|
|
62
|
-
}
|
|
63
|
-
await import_promises.default.mkdir(destinationPath, { recursive: true });
|
|
64
|
-
await mergeDirectory(sourcePath, destinationPath);
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
await import_promises.default.rm(destinationPath, { recursive: true, force: true });
|
|
68
|
-
await import_promises.default.copyFile(sourcePath, destinationPath);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
var syncCustomComponents = async (projectDirectory, catalogDirectory) => {
|
|
72
|
-
const destinationDirectory = import_node_path.default.join(catalogDirectory, "src", "custom-defined-components");
|
|
73
|
-
const destinationParent = import_node_path.default.dirname(destinationDirectory);
|
|
74
|
-
await import_promises.default.mkdir(destinationParent, { recursive: true });
|
|
75
|
-
const stagingDirectory = await import_promises.default.mkdtemp(import_node_path.default.join(destinationParent, ".custom-defined-components.staging-"));
|
|
76
|
-
try {
|
|
77
|
-
await mergeDirectory(import_node_path.default.join(projectDirectory, "federated", "components"), stagingDirectory);
|
|
78
|
-
await mergeDirectory(import_node_path.default.join(projectDirectory, "components"), stagingDirectory);
|
|
79
|
-
await import_promises.default.rm(destinationDirectory, { recursive: true, force: true });
|
|
80
|
-
await import_promises.default.rename(stagingDirectory, destinationDirectory);
|
|
81
|
-
} finally {
|
|
82
|
-
await import_promises.default.rm(stagingDirectory, { recursive: true, force: true });
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
86
|
-
0 && (module.exports = {
|
|
87
|
-
isCustomComponentPath,
|
|
88
|
-
syncCustomComponents
|
|
89
|
-
});
|