@eventcatalog/core 2.10.0 → 2.10.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @eventcatalog/core
2
2
 
3
+ ## 2.10.1
4
+
5
+ ### Patch Changes
6
+
7
+ - e2c99e7: fix(core): fixed issue adding additional properties to users frontmatter on build
8
+
3
9
  ## 2.10.0
4
10
 
5
11
  ### Minor Changes
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "url": "https://github.com/event-catalog/eventcatalog.git"
7
7
  },
8
8
  "type": "module",
9
- "version": "2.10.0",
9
+ "version": "2.10.1",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
@@ -66,6 +66,7 @@
66
66
  "diff": "^7.0.0",
67
67
  "diff2html": "^3.4.48",
68
68
  "glob": "^10.4.1",
69
+ "gray-matter": "^4.0.3",
69
70
  "html-to-image": "^1.11.11",
70
71
  "lodash.merge": "4.6.2",
71
72
  "mermaid": "^10.9.1",
@@ -75,12 +76,12 @@
75
76
  "reactflow": "^11.11.4",
76
77
  "rehype-slug": "^6.0.0",
77
78
  "remark-gfm": "^3.0.1",
79
+ "rimraf": "^5.0.7",
78
80
  "semver": "7.6.3",
79
81
  "tailwindcss": "^3.4.3",
80
82
  "typescript": "^5.4.5",
81
83
  "unist-util-visit": "^5.0.0",
82
- "uuid": "^10.0.0",
83
- "rimraf": "^5.0.7"
84
+ "uuid": "^10.0.0"
84
85
  },
85
86
  "devDependencies": {
86
87
  "@changesets/cli": "^2.27.5",
@@ -4,6 +4,7 @@ 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 matter from 'gray-matter';
7
8
 
8
9
  export async function cleanup(projectDirectory) {
9
10
  const filePath = path.join(projectDirectory, 'eventcatalog.config.mjs');
@@ -82,19 +83,7 @@ export const verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirector
82
83
  };
83
84
 
84
85
  export function addPropertyToFrontMatter(input, newProperty, newValue) {
85
- // Split the input into front matter and content
86
- const [_, frontMatter, content] = input.split('---');
86
+ const file = matter(input);
87
87
 
88
- // Parse the front matter
89
- const frontMatterLines = frontMatter.trim().split('\n');
90
- const updatedFrontMatterLines = [...frontMatterLines];
91
-
92
- // Add the new property
93
- updatedFrontMatterLines.push(`${newProperty}: ${newValue}`);
94
-
95
- // Reconstruct the updated input
96
- const updatedFrontMatter = updatedFrontMatterLines.join('\n');
97
- const updatedInput = `---\n${updatedFrontMatter}\n---\n${content.trim()}`;
98
-
99
- return updatedInput;
88
+ return matter.stringify(file.content, { ...file.data, [newProperty]: newValue });
100
89
  }