@eventcatalog/core 2.8.9 → 2.8.10
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
|
@@ -4,10 +4,9 @@ import { copyFile } from 'node:fs/promises';
|
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { v4 as uuidV4 } from 'uuid';
|
|
6
6
|
import { pathToFileURL } from 'url';
|
|
7
|
-
import { tmpdir } from 'node:os';
|
|
8
7
|
|
|
9
|
-
export async function cleanup() {
|
|
10
|
-
const filePath = path.join(
|
|
8
|
+
export async function cleanup(projectDirectory) {
|
|
9
|
+
const filePath = path.join(projectDirectory, 'eventcatalog.config.mjs');
|
|
11
10
|
if (existsSync(filePath)) {
|
|
12
11
|
await rm(filePath);
|
|
13
12
|
}
|
|
@@ -21,8 +20,8 @@ export const getEventCatalogConfigFile = async (projectDirectory) => {
|
|
|
21
20
|
const packageJson = JSON.parse(await readFile(filePath, 'utf-8'));
|
|
22
21
|
|
|
23
22
|
if (packageJson?.type !== 'module') {
|
|
24
|
-
await copyFile(configFilePath, path.join(
|
|
25
|
-
configFilePath = path.join(
|
|
23
|
+
await copyFile(configFilePath, path.join(projectDirectory, 'eventcatalog.config.mjs'));
|
|
24
|
+
configFilePath = path.join(projectDirectory, 'eventcatalog.config.mjs');
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
const configFileURL = pathToFileURL(configFilePath).href;
|
|
@@ -30,7 +29,7 @@ export const getEventCatalogConfigFile = async (projectDirectory) => {
|
|
|
30
29
|
|
|
31
30
|
return config.default;
|
|
32
31
|
} finally {
|
|
33
|
-
await cleanup();
|
|
32
|
+
await cleanup(projectDirectory);
|
|
34
33
|
}
|
|
35
34
|
};
|
|
36
35
|
|
|
@@ -65,7 +64,7 @@ export const writeEventCatalogConfigFile = async (projectDirectory, newConfig) =
|
|
|
65
64
|
// Write the updated content back to the file
|
|
66
65
|
await writeFile(configFilePath, content);
|
|
67
66
|
} finally {
|
|
68
|
-
await cleanup();
|
|
67
|
+
await cleanup(projectDirectory);
|
|
69
68
|
}
|
|
70
69
|
};
|
|
71
70
|
|