From 0c2f681244e250b8ae305435462d7e7d11d09fd0 Mon Sep 17 00:00:00 2001 From: Carlos Rodrigues Date: Mon, 16 Dec 2024 06:38:11 -0300 Subject: [PATCH] refactor: remove --root and --port flags from astro preview command (#1024) * refactor: remove --root and --port flags from astro preview command This change allows Astro to resolve the configuration using the astro.config.js with the eventcatalog.config.js and the cli options, ensuring proper handling of the options. See https://github.com/event-catalog/eventcatalog/issues/1015#issuecomment-2542025240 * Create friendly-radios-watch.md --------- Co-authored-by: David Boyne --- .changeset/friendly-radios-watch.md | 5 +++++ src/eventcatalog.ts | 14 ++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 .changeset/friendly-radios-watch.md diff --git a/.changeset/friendly-radios-watch.md b/.changeset/friendly-radios-watch.md new file mode 100644 index 00000000..a2bdd760 --- /dev/null +++ b/.changeset/friendly-radios-watch.md @@ -0,0 +1,5 @@ +--- +"@eventcatalog/core": patch +--- + +chore(core): removed --root and --port flags from astro preview command diff --git a/src/eventcatalog.ts b/src/eventcatalog.ts index a4074405..36e0e6ca 100755 --- a/src/eventcatalog.ts +++ b/src/eventcatalog.ts @@ -123,16 +123,10 @@ program }); const previewCatalog = ({ command }: { command: Command }) => { - /** - * TODO: get the port and outDir from the eventcatalog.config.js. - */ - execSync( - `cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npx astro preview --root ${dir} --port 3000 ${command.args.join(' ').trim()}`, - { - cwd: core, - stdio: 'inherit', - } - ); + execSync(`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npx astro preview ${command.args.join(' ').trim()}`, { + cwd: core, + stdio: 'inherit', + }); }; program