Skip to content

Commit

Permalink
refactor: remove --root and --port flags from astro preview command (#…
Browse files Browse the repository at this point in the history
…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 #1015 (comment)

* Create friendly-radios-watch.md

---------

Co-authored-by: David Boyne <[email protected]>
  • Loading branch information
carlosallexandre and boyney123 authored Dec 16, 2024
1 parent fb6c0f2 commit 0c2f681
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/friendly-radios-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@eventcatalog/core": patch
---

chore(core): removed --root and --port flags from astro preview command
14 changes: 4 additions & 10 deletions src/eventcatalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0c2f681

Please sign in to comment.