@eventcatalog/core 2.0.3 → 2.0.5

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,17 @@
1
1
  # @eventcatalog/core
2
2
 
3
+ ## 2.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 4410826: feat(core): adding preview and start commands to eventcatalog
8
+
9
+ ## 2.0.4
10
+
11
+ ### Patch Changes
12
+
13
+ - 00def6d: bug(core): now loads /docs when going to /
14
+
3
15
  ## 2.0.3
4
16
 
5
17
  ### Patch Changes
package/astro.config.mjs CHANGED
@@ -54,4 +54,7 @@ export default defineConfig({
54
54
  }),
55
55
  pagefind(),
56
56
  ],
57
+ redirects: {
58
+ "/": "/docs"
59
+ }
57
60
  });
@@ -3117,14 +3117,12 @@ program2.command("dev").description("Run development server of EventCatalog").op
3117
3117
  copyFolder((0, import_node_path.join)(dir, "public"), (0, import_node_path.join)(core, "public"));
3118
3118
  copyFile((0, import_node_path.join)(dir, "eventcatalog.config.js"), (0, import_node_path.join)(core, "eventcatalog.config.js"));
3119
3119
  copyFile((0, import_node_path.join)(dir, "eventcatalog.styles.css"), (0, import_node_path.join)(core, "eventcatalog.styles.css"));
3120
- const command = options.debug ? "execSync" : "exec";
3121
- const execOptions = { exec: import_node_child_process.exec, execSync: import_node_child_process.execSync };
3122
- execOptions[command](`PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npm run dev`, {
3120
+ console.log("EventCatalog is starting at http://localhost:3000/docs");
3121
+ (0, import_node_child_process.execSync)(`PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npm run dev`, {
3123
3122
  cwd: core,
3124
3123
  // @ts-ignore
3125
3124
  stdio: "inherit"
3126
3125
  });
3127
- console.log("EventCatalog has started on port 3000: http://localhost:3000/docs");
3128
3126
  });
3129
3127
  program2.command("build").description("Run build of EventCatalog").action((options) => {
3130
3128
  console.log("Building EventCatalog...");
@@ -3138,4 +3136,23 @@ program2.command("build").description("Run build of EventCatalog").action((optio
3138
3136
  });
3139
3137
  copyFolder((0, import_node_path.join)(core, "dist"), (0, import_node_path.join)(dir, "dist"));
3140
3138
  });
3139
+ var previewCatalog = () => {
3140
+ copyCore();
3141
+ copyFolder((0, import_node_path.join)(dir, "public"), (0, import_node_path.join)(core, "public"));
3142
+ copyFile((0, import_node_path.join)(dir, "eventcatalog.config.js"), (0, import_node_path.join)(core, "eventcatalog.config.js"));
3143
+ copyFile((0, import_node_path.join)(dir, "eventcatalog.styles.css"), (0, import_node_path.join)(core, "eventcatalog.styles.css"));
3144
+ (0, import_node_child_process.execSync)(`PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npm run preview`, {
3145
+ cwd: core,
3146
+ stdio: "inherit"
3147
+ });
3148
+ copyFolder((0, import_node_path.join)(core, "dist"), (0, import_node_path.join)(dir, "dist"));
3149
+ };
3150
+ program2.command("preview").description("Serves the contents of your eventcatalog build directory").action((options) => {
3151
+ console.log("Starting preview of your build...");
3152
+ previewCatalog();
3153
+ });
3154
+ program2.command("start").description("Serves the contents of your eventcatalog build directory").action((options) => {
3155
+ console.log("Starting preview of your build...");
3156
+ previewCatalog();
3157
+ });
3141
3158
  program2.parse();
@@ -3070,7 +3070,7 @@ var {
3070
3070
  } = import_index.default;
3071
3071
 
3072
3072
  // bin/eventcatalog.ts
3073
- import { exec, execSync } from "node:child_process";
3073
+ import { execSync } from "node:child_process";
3074
3074
  import { join } from "node:path";
3075
3075
  import fs from "fs";
3076
3076
  import path from "node:path";
@@ -3119,14 +3119,12 @@ program2.command("dev").description("Run development server of EventCatalog").op
3119
3119
  copyFolder(join(dir, "public"), join(core, "public"));
3120
3120
  copyFile(join(dir, "eventcatalog.config.js"), join(core, "eventcatalog.config.js"));
3121
3121
  copyFile(join(dir, "eventcatalog.styles.css"), join(core, "eventcatalog.styles.css"));
3122
- const command = options.debug ? "execSync" : "exec";
3123
- const execOptions = { exec, execSync };
3124
- execOptions[command](`PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npm run dev`, {
3122
+ console.log("EventCatalog is starting at http://localhost:3000/docs");
3123
+ execSync(`PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npm run dev`, {
3125
3124
  cwd: core,
3126
3125
  // @ts-ignore
3127
3126
  stdio: "inherit"
3128
3127
  });
3129
- console.log("EventCatalog has started on port 3000: http://localhost:3000/docs");
3130
3128
  });
3131
3129
  program2.command("build").description("Run build of EventCatalog").action((options) => {
3132
3130
  console.log("Building EventCatalog...");
@@ -3140,4 +3138,23 @@ program2.command("build").description("Run build of EventCatalog").action((optio
3140
3138
  });
3141
3139
  copyFolder(join(core, "dist"), join(dir, "dist"));
3142
3140
  });
3141
+ var previewCatalog = () => {
3142
+ copyCore();
3143
+ copyFolder(join(dir, "public"), join(core, "public"));
3144
+ copyFile(join(dir, "eventcatalog.config.js"), join(core, "eventcatalog.config.js"));
3145
+ copyFile(join(dir, "eventcatalog.styles.css"), join(core, "eventcatalog.styles.css"));
3146
+ execSync(`PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npm run preview`, {
3147
+ cwd: core,
3148
+ stdio: "inherit"
3149
+ });
3150
+ copyFolder(join(core, "dist"), join(dir, "dist"));
3151
+ };
3152
+ program2.command("preview").description("Serves the contents of your eventcatalog build directory").action((options) => {
3153
+ console.log("Starting preview of your build...");
3154
+ previewCatalog();
3155
+ });
3156
+ program2.command("start").description("Serves the contents of your eventcatalog build directory").action((options) => {
3157
+ console.log("Starting preview of your build...");
3158
+ previewCatalog();
3159
+ });
3143
3160
  program2.parse();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eventcatalog/core",
3
3
  "type": "module",
4
- "version": "2.0.3",
4
+ "version": "2.0.5",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },