@base44-preview/cli 0.0.36-pr.353.e4eb961 → 0.0.36-pr.353.ee448e6

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/dist/cli/index.js CHANGED
@@ -245864,6 +245864,9 @@ class DirWatcher {
245864
245864
  this.logger = logger;
245865
245865
  }
245866
245866
  async start() {
245867
+ if (this.watcher) {
245868
+ return;
245869
+ }
245867
245870
  if (await pathExists(this.targetDir)) {
245868
245871
  this.watchTarget();
245869
245872
  } else {
@@ -245888,6 +245891,7 @@ class DirWatcher {
245888
245891
  }, WATCH_DEBOUNCE_MS);
245889
245892
  this.watcher = watch(this.targetDir, { ignoreInitial: true });
245890
245893
  this.watcher.on("all", handler);
245894
+ this.watcher.on("error", (err) => this.handleError(err));
245891
245895
  }
245892
245896
  watchParentForCreation() {
245893
245897
  if (this.closed) {
@@ -245912,6 +245916,7 @@ class DirWatcher {
245912
245916
  }, WATCH_DEBOUNCE_MS);
245913
245917
  this.watcher = watch(parentDir, { ignoreInitial: true, depth: 0 });
245914
245918
  this.watcher.on("all", handler);
245919
+ this.watcher.on("error", (err) => this.handleError(err));
245915
245920
  }
245916
245921
  handleError(error48) {
245917
245922
  this.logger.error(`[dev-server] Watch handler failed for ${this.targetDir}`, error48 instanceof Error ? error48 : undefined);
@@ -246339,12 +246344,12 @@ async function createDevServer(options8) {
246339
246344
  const functionsDir = join18(configDir, project2.functionsDir);
246340
246345
  const functionsWatcher = new DirWatcher(functionsDir, async () => {
246341
246346
  const { functions: functions2 } = await options8.loadResources();
246342
- const previousNamesLength = functionManager.getFunctionNames().length;
246347
+ const previousFunctionCount = functionManager.getFunctionNames().length;
246343
246348
  functionManager.reload(functions2);
246344
246349
  const names = functionManager.getFunctionNames();
246345
246350
  if (names.length > 0) {
246346
246351
  devLogger.log(`Reloaded functions: ${names.sort().join(", ")}`);
246347
- } else if (previousNamesLength > 0) {
246352
+ } else if (previousFunctionCount > 0) {
246348
246353
  devLogger.log("All functions removed");
246349
246354
  }
246350
246355
  }, devLogger);
@@ -250733,4 +250738,4 @@ export {
250733
250738
  CLIExitError
250734
250739
  };
250735
250740
 
250736
- //# debugId=EFF117A5EF450AB064756E2164756E21
250741
+ //# debugId=AFD2B8CB8876F48464756E2164756E21