@base44-preview/cli 0.0.36-pr.353.17ecffc → 0.0.36-pr.353.75feba3

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
@@ -244128,7 +244128,9 @@ class FunctionManager {
244128
244128
  }
244129
244129
  });
244130
244130
  process21.on("exit", (code2) => {
244131
- this.logger.log(`[dev-server] Function "${name2}" exited with code ${code2}`);
244131
+ if (code2 !== null) {
244132
+ this.logger.log(`[dev-server] Function "${name2}" exited with code ${code2}`);
244133
+ }
244132
244134
  this.running.delete(name2);
244133
244135
  });
244134
244136
  process21.on("error", (error48) => {
@@ -245862,6 +245864,9 @@ class DirWatcher {
245862
245864
  this.logger = logger;
245863
245865
  }
245864
245866
  async start() {
245867
+ if (this.watcher) {
245868
+ return;
245869
+ }
245865
245870
  if (await pathExists(this.targetDir)) {
245866
245871
  this.watchTarget();
245867
245872
  } else {
@@ -245886,6 +245891,7 @@ class DirWatcher {
245886
245891
  }, WATCH_DEBOUNCE_MS);
245887
245892
  this.watcher = watch(this.targetDir, { ignoreInitial: true });
245888
245893
  this.watcher.on("all", handler);
245894
+ this.watcher.on("error", (err) => this.handleError(err));
245889
245895
  }
245890
245896
  watchParentForCreation() {
245891
245897
  if (this.closed) {
@@ -245910,6 +245916,7 @@ class DirWatcher {
245910
245916
  }, WATCH_DEBOUNCE_MS);
245911
245917
  this.watcher = watch(parentDir, { ignoreInitial: true, depth: 0 });
245912
245918
  this.watcher.on("all", handler);
245919
+ this.watcher.on("error", (err) => this.handleError(err));
245913
245920
  }
245914
245921
  handleError(error48) {
245915
245922
  this.logger.error(`[dev-server] Watch handler failed for ${this.targetDir}`, error48 instanceof Error ? error48 : undefined);
@@ -246337,12 +246344,12 @@ async function createDevServer(options8) {
246337
246344
  const functionsDir = join18(configDir, project2.functionsDir);
246338
246345
  const functionsWatcher = new DirWatcher(functionsDir, async () => {
246339
246346
  const { functions: functions2 } = await options8.loadResources();
246340
- const previousNamesLength = functionManager.getFunctionNames().length;
246347
+ const previousFunctionCount = functionManager.getFunctionNames().length;
246341
246348
  functionManager.reload(functions2);
246342
246349
  const names = functionManager.getFunctionNames();
246343
246350
  if (names.length > 0) {
246344
246351
  devLogger.log(`Reloaded functions: ${names.sort().join(", ")}`);
246345
- } else if (previousNamesLength > 0) {
246352
+ } else if (previousFunctionCount > 0) {
246346
246353
  devLogger.log("All functions removed");
246347
246354
  }
246348
246355
  }, devLogger);
@@ -250731,4 +250738,4 @@ export {
250731
250738
  CLIExitError
250732
250739
  };
250733
250740
 
250734
- //# debugId=34515ECB16FFFDAF64756E2164756E21
250741
+ //# debugId=AFD2B8CB8876F48464756E2164756E21