Skip to content

Commit

Permalink
fix: pagefind not found (event-catalog#712)
Browse files Browse the repository at this point in the history
* chore: remove the empty core dir step in copyCore

It removes the clear core dir step in copyCore to keep the pagefind
index made on build time.

Resolves event-catalog#645

* chore: add --force-recreate flag to eventcatalog dev command

It adds the flag --force-recreate to dev mode. This flag cleanup
the core directory.

* Create few-seas-know.md

---------

Co-authored-by: David Boyne <[email protected]>
  • Loading branch information
carlosallexandre and boyney123 authored Aug 16, 2024
1 parent 7476fa6 commit 20c2cba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/few-seas-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@eventcatalog/core": minor
---

fix(core): fixing search not working after builds
11 changes: 6 additions & 5 deletions bin/eventcatalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ const ensureDir = (dir: string) => {
};

const copyCore = () => {
// First empty the core directory.
if (fs.existsSync(core)) {
fs.rmSync(core, { recursive: true });
}

// make sure the core folder exists
ensureDir(core);

Expand All @@ -61,10 +56,15 @@ const copyCore = () => {
});
};

const clearCore = () => {
if (fs.existsSync(core)) fs.rmSync(core, { recursive: true });
};

program
.command('dev')
.description('Run development server of EventCatalog')
.option('-d, --debug', 'Output EventCatalog application information into your terminal')
.option('--force-recreate', 'Recreate the eventcatalog-core directory', false)
.action((options) => {
// // Copy EventCatalog core over
console.log('Setting up EventCatalog....');
Expand All @@ -75,6 +75,7 @@ program
console.log('CATALOG_DIR', core);
}

if (options.forceRecreate) clearCore();
copyCore();

// // Copy the config and styles
Expand Down

0 comments on commit 20c2cba

Please sign in to comment.