@eventcatalog/core 2.7.15 → 2.7.16
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/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -2,8 +2,9 @@ import { readFile, writeFile, rm } from 'node:fs/promises';
|
|
|
2
2
|
import { existsSync } from 'fs';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { v4 as uuidV4 } from 'uuid';
|
|
5
|
+
import { pathToFileURL } from 'url';
|
|
5
6
|
|
|
6
|
-
// * Very strange
|
|
7
|
+
// * Very strange behavior when importing ESM files from catalogs into core.
|
|
7
8
|
// * Core (node) does not know how to handle ESM files, so we have to try and convert them.
|
|
8
9
|
// *
|
|
9
10
|
// * This needs sorting out! Sorry if you are reading this, but it unblocked me for now!
|
|
@@ -46,7 +47,9 @@ export const getEventCatalogConfigFile = async (projectDirectory) => {
|
|
|
46
47
|
|
|
47
48
|
await writeFile(path.join(projectDirectory, 'eventcatalog.config.cjs'), configAsCommonJS);
|
|
48
49
|
|
|
49
|
-
const
|
|
50
|
+
const configFilePath = path.join(projectDirectory, 'eventcatalog.config.cjs');
|
|
51
|
+
const configFileURL = pathToFileURL(configFilePath).href;
|
|
52
|
+
const configAsCJS = await import(/* @vite-ignore */ configFileURL);
|
|
50
53
|
|
|
51
54
|
// Clean up?
|
|
52
55
|
await writeFile(path.join(projectDirectory, 'eventcatalog.config.js'), rawFile);
|