@eventcatalog/core 2.0.16 → 2.0.17

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.0.17
4
+
5
+ ### Patch Changes
6
+
7
+ - 6337769: feat(core): added ability to customise header text and logo
8
+
3
9
  ## 2.0.16
4
10
 
5
11
  ### Patch Changes
@@ -9,9 +9,10 @@ interface Config {
9
9
  editUrl: string;
10
10
  base?: string;
11
11
  trailingSlash?: boolean;
12
- logo: {
12
+ logo?: {
13
13
  alt: string;
14
14
  src: string;
15
+ text?: string;
15
16
  };
16
17
  docs: {
17
18
  sidebar: {
@@ -9,9 +9,10 @@ interface Config {
9
9
  editUrl: string;
10
10
  base?: string;
11
11
  trailingSlash?: boolean;
12
- logo: {
12
+ logo?: {
13
13
  alt: string;
14
14
  src: string;
15
+ text?: string;
15
16
  };
16
17
  docs: {
17
18
  sidebar: {
@@ -10,9 +10,10 @@ export interface Config {
10
10
  editUrl: string;
11
11
  base?: string;
12
12
  trailingSlash?: boolean;
13
- logo: {
13
+ logo?: {
14
14
  alt: string;
15
15
  src: string;
16
+ text?: string;
16
17
  };
17
18
  docs: {
18
19
  sidebar: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eventcatalog/core",
3
3
  "type": "module",
4
- "version": "2.0.16",
4
+ "version": "2.0.17",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -100,6 +100,15 @@ export const catalogToAstro = async (source, astroContentDir, catalogFilesDir) =
100
100
  // ensureDirSync(astroContentDir);
101
101
  fs.writeFileSync(path.join(astroContentDir, 'config.ts'), astroConfigFile);
102
102
 
103
+ // Copy the public directory files into the astro public directory
104
+ const usersPublicDirectory = path.join(source, 'public');
105
+ const astroPublicDir = path.join(astroContentDir, '../../public');
106
+
107
+ if (fs.existsSync(usersPublicDirectory)) {
108
+ // fs.mkdirSync(astroPublicDir, { recursive: true });
109
+ fs.cpSync(usersPublicDirectory, astroPublicDir, { recursive: true });
110
+ }
111
+
103
112
  // Copy all the event files over
104
113
  await copyFiles({
105
114
  source,
@@ -11,7 +11,6 @@ const catalogDir = join(__dirname, '../');
11
11
  const projectDIR = join(__dirname, `../examples/${catalog}`);
12
12
 
13
13
  fs.copyFileSync(join(projectDIR, 'eventcatalog.config.js'), join(catalogDir, 'eventcatalog.config.js'));
14
-
15
14
  fs.copyFileSync(join(projectDIR, 'eventcatalog.styles.css'), join(catalogDir, 'eventcatalog.styles.css'));
16
15
 
17
16
  execSync(
@@ -21,13 +21,19 @@ const navItems = [
21
21
  }
22
22
  ];
23
23
 
24
+ const logo = {
25
+ src: catalog?.logo?.src || '/logo.png',
26
+ alt: catalog?.logo?.alt || 'Event Catalog',
27
+ text: catalog?.logo?.text || "EventCatalog"
28
+ }
29
+
24
30
  ---
25
31
  <nav class="md:fixed top-0 w-full z-20 bg-white border-b border-gray-200 py-4 font-bold text-xl max-w-[70em]">
26
32
  <div class="flex justify-between items-center">
27
33
  <div class="w-1/3 flex space-x-2 items-center">
28
34
  <a href={buildUrl('/docs')} class="flex space-x-2 items-center">
29
- <img src={buildUrl('/logo.png', true)} class="w-8" />
30
- <span class="hidden sm:inline-block text-[1em]">{catalog.title}</span>
35
+ {logo.src && <img alt={logo.alt} src={buildUrl(logo.src, true)} class="w-8" />}
36
+ {logo.text && <span class="hidden sm:inline-block text-[1em]">{logo.text}</span>}
31
37
  </a>
32
38
  </div>
33
39
  <div class="w-1/3 md:block hidden">