@base44-preview/cli 0.0.44-pr.412.e5a2e1d → 0.0.44-pr.412.e87fc06

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
@@ -238473,22 +238473,27 @@ async function deployFunctionsSequentially(functions, options) {
238473
238473
  }
238474
238474
  return results;
238475
238475
  }
238476
- async function pruneRemovedFunctions(localFunctionNames) {
238476
+ async function pruneRemovedFunctions(localFunctionNames, options) {
238477
238477
  const remote = await listDeployedFunctions();
238478
238478
  const localSet = new Set(localFunctionNames);
238479
238479
  const toDelete = remote.functions.filter((f) => !localSet.has(f.name));
238480
+ options?.onStart?.(toDelete.length);
238480
238481
  const results = [];
238481
238482
  for (const fn of toDelete) {
238483
+ options?.onBeforeDelete?.(fn.name);
238484
+ let result;
238482
238485
  try {
238483
238486
  await deleteSingleFunction(fn.name);
238484
- results.push({ name: fn.name, deleted: true });
238487
+ result = { name: fn.name, deleted: true };
238485
238488
  } catch (error48) {
238486
- results.push({
238489
+ result = {
238487
238490
  name: fn.name,
238488
238491
  deleted: false,
238489
238492
  error: error48 instanceof Error ? error48.message : String(error48)
238490
- });
238493
+ };
238491
238494
  }
238495
+ results.push(result);
238496
+ options?.onResult?.(result);
238492
238497
  }
238493
238498
  return results;
238494
238499
  }
@@ -247822,17 +247827,17 @@ function resolveFunctionsToDeploy(names, allFunctions) {
247822
247827
  }
247823
247828
  return allFunctions.filter((f) => names.includes(f.name));
247824
247829
  }
247825
- function formatPruneResults(pruneResults) {
247826
- for (const pruneResult of pruneResults) {
247827
- if (pruneResult.deleted) {
247828
- R2.success(`${pruneResult.name.padEnd(25)} deleted`);
247829
- } else {
247830
- R2.error(`${pruneResult.name.padEnd(25)} error: ${pruneResult.error}`);
247831
- }
247830
+ function formatPruneResult(pruneResult) {
247831
+ if (pruneResult.deleted) {
247832
+ R2.success(`${pruneResult.name.padEnd(25)} deleted`);
247833
+ } else {
247834
+ R2.error(`${pruneResult.name.padEnd(25)} error: ${pruneResult.error}`);
247832
247835
  }
247836
+ }
247837
+ function formatPruneSummary(pruneResults) {
247833
247838
  if (pruneResults.length > 0) {
247834
247839
  const pruned = pruneResults.filter((r) => r.deleted).length;
247835
- R2.info(`${pruned} function${pruned !== 1 ? "s" : ""} removed`);
247840
+ R2.info(`${pruned} deleted`);
247836
247841
  }
247837
247842
  }
247838
247843
  function buildDeploySummary(results) {
@@ -247873,10 +247878,23 @@ async function deployFunctionsAction(names, options) {
247873
247878
  }
247874
247879
  });
247875
247880
  if (options.force) {
247876
- R2.info("Removing remote functions not found locally...");
247877
247881
  const allLocalNames = functions.map((f) => f.name);
247878
- const pruneResults = await pruneRemovedFunctions(allLocalNames);
247879
- formatPruneResults(pruneResults);
247882
+ let pruneCompleted = 0;
247883
+ let pruneTotal = 0;
247884
+ const pruneResults = await pruneRemovedFunctions(allLocalNames, {
247885
+ onStart: (total2) => {
247886
+ pruneTotal = total2;
247887
+ if (total2 > 0) {
247888
+ R2.info(`Found ${total2} remote ${total2 === 1 ? "function" : "functions"} to delete`);
247889
+ }
247890
+ },
247891
+ onBeforeDelete: (name2) => {
247892
+ pruneCompleted++;
247893
+ R2.step(theme.styles.dim(`[${pruneCompleted}/${pruneTotal}] Deleting ${name2}...`));
247894
+ },
247895
+ onResult: formatPruneResult
247896
+ });
247897
+ formatPruneSummary(pruneResults);
247880
247898
  }
247881
247899
  return { outroMessage: buildDeploySummary(results) };
247882
247900
  }
@@ -255753,4 +255771,4 @@ export {
255753
255771
  CLIExitError
255754
255772
  };
255755
255773
 
255756
- //# debugId=8533D2C01A675ED464756E2164756E21
255774
+ //# debugId=9A2E9C491721ADA564756E2164756E21