@base44-preview/cli 0.0.38-pr.377.8963484 → 0.0.38-pr.378.bb7fa12

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
@@ -233897,11 +233897,12 @@ var AutomationSchema = exports_external.union([
233897
233897
  EntityAutomationSchema
233898
233898
  ]);
233899
233899
  var FunctionConfigSchema = exports_external.object({
233900
- name: FunctionNameSchema,
233900
+ name: FunctionNameSchema.optional(),
233901
233901
  entry: exports_external.string().min(1, "Entry point cannot be empty"),
233902
233902
  automations: exports_external.array(AutomationSchema).optional()
233903
233903
  });
233904
233904
  var BackendFunctionSchema = FunctionConfigSchema.extend({
233905
+ name: FunctionNameSchema,
233905
233906
  entryPath: exports_external.string().min(1, "Entry path cannot be empty"),
233906
233907
  filePaths: exports_external.array(exports_external.string()).min(1, "Function must have at least one file")
233907
233908
  });
@@ -233994,9 +233995,10 @@ async function readFunctionConfig(configPath) {
233994
233995
  }
233995
233996
  return result.data;
233996
233997
  }
233997
- async function readFunction(configPath) {
233998
+ async function readFunction(configPath, functionsDir) {
233998
233999
  const config5 = await readFunctionConfig(configPath);
233999
234000
  const functionDir = dirname4(configPath);
234001
+ const name2 = config5.name ?? relative(functionsDir, functionDir).split(/[/\\]/).join("/");
234000
234002
  const entryPath = join5(functionDir, config5.entry);
234001
234003
  if (!await pathExists(entryPath)) {
234002
234004
  throw new InvalidInputError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`, {
@@ -234007,7 +234009,7 @@ async function readFunction(configPath) {
234007
234009
  cwd: functionDir,
234008
234010
  absolute: true
234009
234011
  });
234010
- const functionData = { ...config5, entryPath, filePaths };
234012
+ const functionData = { ...config5, name: name2, entryPath, filePaths };
234011
234013
  return functionData;
234012
234014
  }
234013
234015
  async function readAllFunctions(functionsDir) {
@@ -234025,7 +234027,7 @@ async function readAllFunctions(functionsDir) {
234025
234027
  });
234026
234028
  const configFilesDirs = new Set(configFiles.map((f) => dirname4(f)));
234027
234029
  const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(dirname4(entryFile)));
234028
- const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
234030
+ const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath, functionsDir)));
234029
234031
  const functionsWithoutConfig = await Promise.all(entryFilesWithoutConfig.map(async (entryFile) => {
234030
234032
  const functionDir = dirname4(entryFile);
234031
234033
  const filePaths = await globby("**/*.{js,ts,json}", {
@@ -250855,4 +250857,4 @@ export {
250855
250857
  CLIExitError
250856
250858
  };
250857
250859
 
250858
- //# debugId=E98D9FF553DE25D164756E2164756E21
250860
+ //# debugId=46902C4097C5377B64756E2164756E21