@base44-preview/cli 0.0.24-pr.146.1f5fa93 → 0.0.24-pr.147.be1c0f9
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/index.js +9 -21
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16730,10 +16730,7 @@ const FunctionConfigSchema = object({
|
|
|
16730
16730
|
entry: string().min(1, "Entry point cannot be empty"),
|
|
16731
16731
|
triggers: tuple([]).optional()
|
|
16732
16732
|
});
|
|
16733
|
-
const FunctionSchema = FunctionConfigSchema.extend({
|
|
16734
|
-
codePath: string().min(1, "Code path cannot be empty"),
|
|
16735
|
-
codePaths: array(string()).min(1, "Code paths cannot be empty")
|
|
16736
|
-
});
|
|
16733
|
+
const FunctionSchema = FunctionConfigSchema.extend({ codePath: string().min(1, "Code path cannot be empty") });
|
|
16737
16734
|
const DeployFunctionsResponseSchema = object({
|
|
16738
16735
|
deployed: array(string()),
|
|
16739
16736
|
deleted: array(string()),
|
|
@@ -16753,17 +16750,11 @@ async function readFunctionConfig(configPath) {
|
|
|
16753
16750
|
}
|
|
16754
16751
|
async function readFunction(configPath) {
|
|
16755
16752
|
const config$1 = await readFunctionConfig(configPath);
|
|
16756
|
-
const
|
|
16757
|
-
const codePath = join(functionDir, config$1.entry);
|
|
16753
|
+
const codePath = join(dirname(configPath), config$1.entry);
|
|
16758
16754
|
if (!await pathExists(codePath)) throw new Error(`Function code file not found: ${codePath} (referenced in ${configPath})`);
|
|
16759
|
-
const allFiles = await globby("*.ts", {
|
|
16760
|
-
cwd: functionDir,
|
|
16761
|
-
absolute: true
|
|
16762
|
-
});
|
|
16763
16755
|
const functionData = {
|
|
16764
16756
|
...config$1,
|
|
16765
|
-
codePath
|
|
16766
|
-
codePaths: allFiles
|
|
16757
|
+
codePath
|
|
16767
16758
|
};
|
|
16768
16759
|
const result = FunctionSchema.safeParse(functionData);
|
|
16769
16760
|
if (!result.success) throw new Error(`Invalid function in ${configPath}: ${result.error.message}`);
|
|
@@ -16790,7 +16781,10 @@ function toDeployPayloadItem(fn) {
|
|
|
16790
16781
|
return {
|
|
16791
16782
|
name: fn.name,
|
|
16792
16783
|
entry: fn.entry,
|
|
16793
|
-
files:
|
|
16784
|
+
files: [{
|
|
16785
|
+
path: fn.entry,
|
|
16786
|
+
content: fn.code
|
|
16787
|
+
}]
|
|
16794
16788
|
};
|
|
16795
16789
|
}
|
|
16796
16790
|
async function deployFunctions(functions) {
|
|
@@ -16806,16 +16800,10 @@ async function deployFunctions(functions) {
|
|
|
16806
16800
|
//#endregion
|
|
16807
16801
|
//#region src/core/resources/function/deploy.ts
|
|
16808
16802
|
async function loadFunctionCode(fn) {
|
|
16809
|
-
const
|
|
16810
|
-
const content = await readTextFile(filePath);
|
|
16811
|
-
return {
|
|
16812
|
-
path: basename(filePath),
|
|
16813
|
-
content
|
|
16814
|
-
};
|
|
16815
|
-
}));
|
|
16803
|
+
const code$1 = await readTextFile(fn.codePath);
|
|
16816
16804
|
return {
|
|
16817
16805
|
...fn,
|
|
16818
|
-
|
|
16806
|
+
code: code$1
|
|
16819
16807
|
};
|
|
16820
16808
|
}
|
|
16821
16809
|
async function pushFunctions(functions) {
|