@base44-preview/cli 0.0.41-pr.382.359de3c → 0.0.41-pr.386.1c19d2c
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/assets/deno-runtime/main.ts +72 -0
- package/dist/cli/index.js +65 -205
- package/dist/cli/index.js.map +8 -11
- package/package.json +85 -86
- package/dist/assets/deno-runtime/main.js +0 -31
- package/dist/assets/deno-runtime/main.js.map +0 -10
package/dist/cli/index.js
CHANGED
|
@@ -18040,7 +18040,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
|
18040
18040
|
}
|
|
18041
18041
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
|
|
18042
18042
|
});
|
|
18043
|
-
function
|
|
18043
|
+
function join13(array2, separator) {
|
|
18044
18044
|
return array2 == null ? "" : nativeJoin.call(array2, separator);
|
|
18045
18045
|
}
|
|
18046
18046
|
function last(array2) {
|
|
@@ -18062,7 +18062,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
|
18062
18062
|
function nth(array2, n2) {
|
|
18063
18063
|
return array2 && array2.length ? baseNth(array2, toInteger(n2)) : undefined2;
|
|
18064
18064
|
}
|
|
18065
|
-
var
|
|
18065
|
+
var pull = baseRest(pullAll);
|
|
18066
18066
|
function pullAll(array2, values2) {
|
|
18067
18067
|
return array2 && array2.length && values2 && values2.length ? basePullAll(array2, values2) : array2;
|
|
18068
18068
|
}
|
|
@@ -19827,7 +19827,7 @@ __p += '`;
|
|
|
19827
19827
|
lodash.pickBy = pickBy;
|
|
19828
19828
|
lodash.property = property;
|
|
19829
19829
|
lodash.propertyOf = propertyOf;
|
|
19830
|
-
lodash.pull =
|
|
19830
|
+
lodash.pull = pull;
|
|
19831
19831
|
lodash.pullAll = pullAll;
|
|
19832
19832
|
lodash.pullAllBy = pullAllBy;
|
|
19833
19833
|
lodash.pullAllWith = pullAllWith;
|
|
@@ -19972,7 +19972,7 @@ __p += '`;
|
|
|
19972
19972
|
lodash.isUndefined = isUndefined;
|
|
19973
19973
|
lodash.isWeakMap = isWeakMap;
|
|
19974
19974
|
lodash.isWeakSet = isWeakSet;
|
|
19975
|
-
lodash.join =
|
|
19975
|
+
lodash.join = join13;
|
|
19976
19976
|
lodash.kebabCase = kebabCase2;
|
|
19977
19977
|
lodash.last = last;
|
|
19978
19978
|
lodash.lastIndexOf = lastIndexOf;
|
|
@@ -20601,7 +20601,7 @@ function cleanDoc(doc2) {
|
|
|
20601
20601
|
return mapDoc(doc2, (currentDoc) => cleanDocFn(currentDoc));
|
|
20602
20602
|
}
|
|
20603
20603
|
function replaceEndOfLine(doc2, replacement = literalline) {
|
|
20604
|
-
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ?
|
|
20604
|
+
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ? join13(replacement, currentDoc.split(`
|
|
20605
20605
|
`)) : currentDoc);
|
|
20606
20606
|
}
|
|
20607
20607
|
function canBreakFn(doc2) {
|
|
@@ -20681,7 +20681,7 @@ function indentIfBreak(contents, options) {
|
|
|
20681
20681
|
negate: options.negate
|
|
20682
20682
|
};
|
|
20683
20683
|
}
|
|
20684
|
-
function
|
|
20684
|
+
function join13(separator, docs) {
|
|
20685
20685
|
assertDoc(separator);
|
|
20686
20686
|
assertDocArray(docs);
|
|
20687
20687
|
const parts = [];
|
|
@@ -21392,7 +21392,7 @@ var init_doc = __esm(() => {
|
|
|
21392
21392
|
MODE_FLAT = Symbol("MODE_FLAT");
|
|
21393
21393
|
DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
21394
21394
|
builders = {
|
|
21395
|
-
join:
|
|
21395
|
+
join: join13,
|
|
21396
21396
|
line,
|
|
21397
21397
|
softline,
|
|
21398
21398
|
hardline,
|
|
@@ -126306,7 +126306,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
126306
126306
|
return mapDoc2(doc2, (currentDoc) => cleanDocFn2(currentDoc));
|
|
126307
126307
|
}
|
|
126308
126308
|
function replaceEndOfLine2(doc2, replacement = literalline2) {
|
|
126309
|
-
return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ?
|
|
126309
|
+
return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ? join15(replacement, currentDoc.split(`
|
|
126310
126310
|
`)) : currentDoc);
|
|
126311
126311
|
}
|
|
126312
126312
|
function canBreakFn2(doc2) {
|
|
@@ -126392,7 +126392,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
126392
126392
|
negate: options8.negate
|
|
126393
126393
|
};
|
|
126394
126394
|
}
|
|
126395
|
-
function
|
|
126395
|
+
function join15(separator, docs) {
|
|
126396
126396
|
assertDoc2(separator);
|
|
126397
126397
|
assertDocArray2(docs);
|
|
126398
126398
|
const parts = [];
|
|
@@ -127057,7 +127057,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
127057
127057
|
}
|
|
127058
127058
|
}
|
|
127059
127059
|
var builders2 = {
|
|
127060
|
-
join:
|
|
127060
|
+
join: join15,
|
|
127061
127061
|
line: line3,
|
|
127062
127062
|
softline: softline2,
|
|
127063
127063
|
hardline: hardline4,
|
|
@@ -153497,10 +153497,10 @@ var require_view = __commonJS((exports, module) => {
|
|
|
153497
153497
|
var debug = require_src4()("express:view");
|
|
153498
153498
|
var path18 = __require("node:path");
|
|
153499
153499
|
var fs28 = __require("node:fs");
|
|
153500
|
-
var
|
|
153500
|
+
var dirname11 = path18.dirname;
|
|
153501
153501
|
var basename4 = path18.basename;
|
|
153502
153502
|
var extname2 = path18.extname;
|
|
153503
|
-
var
|
|
153503
|
+
var join16 = path18.join;
|
|
153504
153504
|
var resolve6 = path18.resolve;
|
|
153505
153505
|
module.exports = View;
|
|
153506
153506
|
function View(name2, options8) {
|
|
@@ -153536,7 +153536,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
153536
153536
|
for (var i5 = 0;i5 < roots.length && !path19; i5++) {
|
|
153537
153537
|
var root2 = roots[i5];
|
|
153538
153538
|
var loc = resolve6(root2, name2);
|
|
153539
|
-
var dir =
|
|
153539
|
+
var dir = dirname11(loc);
|
|
153540
153540
|
var file2 = basename4(loc);
|
|
153541
153541
|
path19 = this.resolve(dir, file2);
|
|
153542
153542
|
}
|
|
@@ -153562,12 +153562,12 @@ var require_view = __commonJS((exports, module) => {
|
|
|
153562
153562
|
};
|
|
153563
153563
|
View.prototype.resolve = function resolve7(dir, file2) {
|
|
153564
153564
|
var ext = this.ext;
|
|
153565
|
-
var path19 =
|
|
153565
|
+
var path19 = join16(dir, file2);
|
|
153566
153566
|
var stat2 = tryStat(path19);
|
|
153567
153567
|
if (stat2 && stat2.isFile()) {
|
|
153568
153568
|
return path19;
|
|
153569
153569
|
}
|
|
153570
|
-
path19 =
|
|
153570
|
+
path19 = join16(dir, basename4(file2, ext), "index" + ext);
|
|
153571
153571
|
stat2 = tryStat(path19);
|
|
153572
153572
|
if (stat2 && stat2.isFile()) {
|
|
153573
153573
|
return path19;
|
|
@@ -157262,7 +157262,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
157262
157262
|
var Stream2 = __require("stream");
|
|
157263
157263
|
var util2 = __require("util");
|
|
157264
157264
|
var extname2 = path18.extname;
|
|
157265
|
-
var
|
|
157265
|
+
var join16 = path18.join;
|
|
157266
157266
|
var normalize = path18.normalize;
|
|
157267
157267
|
var resolve6 = path18.resolve;
|
|
157268
157268
|
var sep = path18.sep;
|
|
@@ -157434,7 +157434,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
157434
157434
|
return res;
|
|
157435
157435
|
}
|
|
157436
157436
|
parts = path19.split(sep);
|
|
157437
|
-
path19 = normalize(
|
|
157437
|
+
path19 = normalize(join16(root2, path19));
|
|
157438
157438
|
} else {
|
|
157439
157439
|
if (UP_PATH_REGEXP.test(path19)) {
|
|
157440
157440
|
debug('malicious path "%s"', path19);
|
|
@@ -157574,7 +157574,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
157574
157574
|
return self2.onStatError(err);
|
|
157575
157575
|
return self2.error(404);
|
|
157576
157576
|
}
|
|
157577
|
-
var p4 =
|
|
157577
|
+
var p4 = join16(path19, self2._index[i5]);
|
|
157578
157578
|
debug('stat "%s"', p4);
|
|
157579
157579
|
fs28.stat(p4, function(err2, stat2) {
|
|
157580
157580
|
if (err2)
|
|
@@ -204169,7 +204169,7 @@ var require_buffer_list = __commonJS((exports, module) => {
|
|
|
204169
204169
|
}
|
|
204170
204170
|
}, {
|
|
204171
204171
|
key: "join",
|
|
204172
|
-
value: function
|
|
204172
|
+
value: function join16(s5) {
|
|
204173
204173
|
if (this.length === 0)
|
|
204174
204174
|
return "";
|
|
204175
204175
|
var p4 = this.head;
|
|
@@ -207880,7 +207880,7 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
207880
207880
|
});
|
|
207881
207881
|
|
|
207882
207882
|
// src/cli/index.ts
|
|
207883
|
-
import { dirname as
|
|
207883
|
+
import { dirname as dirname15, join as join19 } from "node:path";
|
|
207884
207884
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
207885
207885
|
|
|
207886
207886
|
// ../../node_modules/commander/esm.mjs
|
|
@@ -207900,7 +207900,7 @@ var {
|
|
|
207900
207900
|
} = import__.default;
|
|
207901
207901
|
|
|
207902
207902
|
// src/cli/commands/agents/pull.ts
|
|
207903
|
-
import { dirname as dirname7, join as
|
|
207903
|
+
import { dirname as dirname7, join as join10 } from "node:path";
|
|
207904
207904
|
|
|
207905
207905
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
207906
207906
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
@@ -230396,7 +230396,7 @@ var generateGlobTasks = normalizeArguments(generateTasks);
|
|
|
230396
230396
|
var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
|
|
230397
230397
|
|
|
230398
230398
|
// src/core/project/config.ts
|
|
230399
|
-
import { dirname as dirname5, join as
|
|
230399
|
+
import { dirname as dirname5, join as join6 } from "node:path";
|
|
230400
230400
|
|
|
230401
230401
|
// src/core/resources/agent/schema.ts
|
|
230402
230402
|
var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
|
|
@@ -231132,21 +231132,6 @@ var DeployFunctionsResponseSchema = exports_external.object({
|
|
|
231132
231132
|
skipped: exports_external.array(exports_external.string()).optional().nullable(),
|
|
231133
231133
|
errors: exports_external.array(exports_external.object({ name: exports_external.string(), message: exports_external.string() })).nullable()
|
|
231134
231134
|
});
|
|
231135
|
-
var FunctionAutomationInfoSchema = exports_external.object({
|
|
231136
|
-
name: exports_external.string(),
|
|
231137
|
-
type: exports_external.string(),
|
|
231138
|
-
is_active: exports_external.boolean()
|
|
231139
|
-
});
|
|
231140
|
-
var FunctionInfoSchema = exports_external.object({
|
|
231141
|
-
name: exports_external.string(),
|
|
231142
|
-
deployment_id: exports_external.string(),
|
|
231143
|
-
entry: exports_external.string(),
|
|
231144
|
-
files: exports_external.array(FunctionFileSchema),
|
|
231145
|
-
automations: exports_external.array(FunctionAutomationInfoSchema)
|
|
231146
|
-
});
|
|
231147
|
-
var ListFunctionsResponseSchema = exports_external.object({
|
|
231148
|
-
functions: exports_external.array(FunctionInfoSchema)
|
|
231149
|
-
});
|
|
231150
231135
|
var LogLevelSchema = exports_external.enum(["info", "warning", "error", "debug"]);
|
|
231151
231136
|
var FunctionLogEntrySchema = exports_external.object({
|
|
231152
231137
|
time: exports_external.string(),
|
|
@@ -231220,20 +231205,6 @@ async function fetchFunctionLogs(functionName, filters = {}) {
|
|
|
231220
231205
|
}
|
|
231221
231206
|
return result.data;
|
|
231222
231207
|
}
|
|
231223
|
-
async function listDeployedFunctions() {
|
|
231224
|
-
const appClient = getAppClient();
|
|
231225
|
-
let response;
|
|
231226
|
-
try {
|
|
231227
|
-
response = await appClient.get("backend-functions", { timeout: 30000 });
|
|
231228
|
-
} catch (error48) {
|
|
231229
|
-
throw await ApiError.fromHttpError(error48, "listing deployed functions");
|
|
231230
|
-
}
|
|
231231
|
-
const result = ListFunctionsResponseSchema.safeParse(await response.json());
|
|
231232
|
-
if (!result.success) {
|
|
231233
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
231234
|
-
}
|
|
231235
|
-
return result.data;
|
|
231236
|
-
}
|
|
231237
231208
|
// src/core/resources/function/config.ts
|
|
231238
231209
|
import { basename as basename2, dirname as dirname3, join as join5, relative } from "node:path";
|
|
231239
231210
|
async function readFunctionConfig(configPath) {
|
|
@@ -231329,67 +231300,6 @@ async function pushFunctions(functions) {
|
|
|
231329
231300
|
const functionsWithCode = await Promise.all(functions.map(loadFunctionCode));
|
|
231330
231301
|
return deployFunctions(functionsWithCode);
|
|
231331
231302
|
}
|
|
231332
|
-
// src/core/resources/function/pull.ts
|
|
231333
|
-
import { join as join6 } from "node:path";
|
|
231334
|
-
async function writeFunctions(functionsDir, functions) {
|
|
231335
|
-
const written = [];
|
|
231336
|
-
const skipped = [];
|
|
231337
|
-
for (const fn of functions) {
|
|
231338
|
-
const functionDir = join6(functionsDir, fn.name);
|
|
231339
|
-
const configPath = join6(functionDir, "function.jsonc");
|
|
231340
|
-
if (await isFunctionUnchanged(functionDir, fn)) {
|
|
231341
|
-
skipped.push(fn.name);
|
|
231342
|
-
continue;
|
|
231343
|
-
}
|
|
231344
|
-
const config5 = {
|
|
231345
|
-
name: fn.name,
|
|
231346
|
-
entry: fn.entry
|
|
231347
|
-
};
|
|
231348
|
-
if (fn.automations.length > 0) {
|
|
231349
|
-
config5.automations = fn.automations;
|
|
231350
|
-
}
|
|
231351
|
-
await writeJsonFile(configPath, config5);
|
|
231352
|
-
for (const file2 of fn.files) {
|
|
231353
|
-
await writeFile(join6(functionDir, file2.path), file2.content);
|
|
231354
|
-
}
|
|
231355
|
-
written.push(fn.name);
|
|
231356
|
-
}
|
|
231357
|
-
return { written, skipped };
|
|
231358
|
-
}
|
|
231359
|
-
async function isFunctionUnchanged(functionDir, fn) {
|
|
231360
|
-
if (!await pathExists(functionDir)) {
|
|
231361
|
-
return false;
|
|
231362
|
-
}
|
|
231363
|
-
const configPath = join6(functionDir, "function.jsonc");
|
|
231364
|
-
try {
|
|
231365
|
-
const localConfig = await readJsonFile(configPath);
|
|
231366
|
-
if (localConfig.entry !== fn.entry) {
|
|
231367
|
-
return false;
|
|
231368
|
-
}
|
|
231369
|
-
const localAuto = JSON.stringify(localConfig.automations ?? []);
|
|
231370
|
-
const remoteAuto = JSON.stringify(fn.automations);
|
|
231371
|
-
if (localAuto !== remoteAuto) {
|
|
231372
|
-
return false;
|
|
231373
|
-
}
|
|
231374
|
-
} catch {
|
|
231375
|
-
return false;
|
|
231376
|
-
}
|
|
231377
|
-
for (const file2 of fn.files) {
|
|
231378
|
-
const filePath = join6(functionDir, file2.path);
|
|
231379
|
-
if (!await pathExists(filePath)) {
|
|
231380
|
-
return false;
|
|
231381
|
-
}
|
|
231382
|
-
try {
|
|
231383
|
-
const localContent = await readTextFile(filePath);
|
|
231384
|
-
if (localContent !== file2.content) {
|
|
231385
|
-
return false;
|
|
231386
|
-
}
|
|
231387
|
-
} catch {
|
|
231388
|
-
return false;
|
|
231389
|
-
}
|
|
231390
|
-
}
|
|
231391
|
-
return true;
|
|
231392
|
-
}
|
|
231393
231303
|
// src/core/resources/function/resource.ts
|
|
231394
231304
|
var functionResource = {
|
|
231395
231305
|
readAll: readAllFunctions,
|
|
@@ -231434,10 +231344,10 @@ async function readProjectConfig(projectRoot) {
|
|
|
231434
231344
|
const project = result.data;
|
|
231435
231345
|
const configDir = dirname5(configPath);
|
|
231436
231346
|
const [entities, functions, agents, connectors] = await Promise.all([
|
|
231437
|
-
entityResource.readAll(
|
|
231438
|
-
functionResource.readAll(
|
|
231439
|
-
agentResource.readAll(
|
|
231440
|
-
connectorResource.readAll(
|
|
231347
|
+
entityResource.readAll(join6(configDir, project.entitiesDir)),
|
|
231348
|
+
functionResource.readAll(join6(configDir, project.functionsDir)),
|
|
231349
|
+
agentResource.readAll(join6(configDir, project.agentsDir)),
|
|
231350
|
+
connectorResource.readAll(join6(configDir, project.connectorsDir))
|
|
231441
231351
|
]);
|
|
231442
231352
|
return {
|
|
231443
231353
|
project: { ...project, root, configPath },
|
|
@@ -231534,12 +231444,12 @@ async function readAppConfig(projectRoot) {
|
|
|
231534
231444
|
// src/core/project/template.ts
|
|
231535
231445
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
231536
231446
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
231537
|
-
import { dirname as dirname6, join as
|
|
231447
|
+
import { dirname as dirname6, join as join8 } from "node:path";
|
|
231538
231448
|
|
|
231539
231449
|
// src/core/assets.ts
|
|
231540
231450
|
import { cpSync, existsSync } from "node:fs";
|
|
231541
231451
|
import { homedir as homedir2 } from "node:os";
|
|
231542
|
-
import { join as
|
|
231452
|
+
import { join as join7 } from "node:path";
|
|
231543
231453
|
// package.json
|
|
231544
231454
|
var package_default = {
|
|
231545
231455
|
name: "base44",
|
|
@@ -231561,10 +231471,10 @@ var package_default = {
|
|
|
231561
231471
|
dev: "./bin/dev.ts",
|
|
231562
231472
|
start: "./bin/run.js",
|
|
231563
231473
|
clean: "rm -rf dist && mkdir -p dist",
|
|
231564
|
-
lint: "biome check src tests",
|
|
231565
|
-
"lint:fix": "biome check --write src tests",
|
|
231566
231474
|
test: "vitest run",
|
|
231567
231475
|
"test:watch": "vitest",
|
|
231476
|
+
lint: "cd ../.. && bun run lint",
|
|
231477
|
+
"lint:fix": "cd ../.. && bun run lint:fix",
|
|
231568
231478
|
"build:binaries": "bun run infra/build-binaries.ts",
|
|
231569
231479
|
"package:binaries": "bun run infra/package-binaries.ts"
|
|
231570
231480
|
},
|
|
@@ -231580,7 +231490,6 @@ var package_default = {
|
|
|
231580
231490
|
url: "https://github.com/base44/cli"
|
|
231581
231491
|
},
|
|
231582
231492
|
devDependencies: {
|
|
231583
|
-
"@biomejs/biome": "^2.0.0",
|
|
231584
231493
|
"@clack/prompts": "^1.0.1",
|
|
231585
231494
|
"@seald-io/nedb": "^4.1.2",
|
|
231586
231495
|
"@types/bun": "^1.2.15",
|
|
@@ -231631,15 +231540,15 @@ var package_default = {
|
|
|
231631
231540
|
};
|
|
231632
231541
|
|
|
231633
231542
|
// src/core/assets.ts
|
|
231634
|
-
var ASSETS_DIR =
|
|
231543
|
+
var ASSETS_DIR = join7(homedir2(), ".base44", "assets", package_default.version);
|
|
231635
231544
|
function getTemplatesDir() {
|
|
231636
|
-
return
|
|
231545
|
+
return join7(ASSETS_DIR, "templates");
|
|
231637
231546
|
}
|
|
231638
231547
|
function getTemplatesIndexPath() {
|
|
231639
|
-
return
|
|
231548
|
+
return join7(ASSETS_DIR, "templates", "templates.json");
|
|
231640
231549
|
}
|
|
231641
231550
|
function getDenoWrapperPath() {
|
|
231642
|
-
return
|
|
231551
|
+
return join7(ASSETS_DIR, "deno-runtime", "main.ts");
|
|
231643
231552
|
}
|
|
231644
231553
|
function ensureNpmAssets(sourceDir) {
|
|
231645
231554
|
if (existsSync(ASSETS_DIR))
|
|
@@ -231660,23 +231569,23 @@ async function listTemplates() {
|
|
|
231660
231569
|
return result.data.templates;
|
|
231661
231570
|
}
|
|
231662
231571
|
async function renderTemplate(template, destPath, data) {
|
|
231663
|
-
const templateDir =
|
|
231572
|
+
const templateDir = join8(getTemplatesDir(), template.path);
|
|
231664
231573
|
const files = await globby("**/*", {
|
|
231665
231574
|
cwd: templateDir,
|
|
231666
231575
|
dot: true,
|
|
231667
231576
|
onlyFiles: true
|
|
231668
231577
|
});
|
|
231669
231578
|
for (const file2 of files) {
|
|
231670
|
-
const srcPath =
|
|
231579
|
+
const srcPath = join8(templateDir, file2);
|
|
231671
231580
|
try {
|
|
231672
231581
|
if (file2.endsWith(".ejs")) {
|
|
231673
231582
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
231674
231583
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
231675
|
-
const destFile = attributes.outputFileName ?
|
|
231676
|
-
const destFilePath =
|
|
231584
|
+
const destFile = attributes.outputFileName ? join8(dirname6(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
231585
|
+
const destFilePath = join8(destPath, destFile);
|
|
231677
231586
|
await writeFile(destFilePath, body);
|
|
231678
231587
|
} else {
|
|
231679
|
-
const destFilePath =
|
|
231588
|
+
const destFilePath = join8(destPath, file2);
|
|
231680
231589
|
await copyFile(srcPath, destFilePath);
|
|
231681
231590
|
}
|
|
231682
231591
|
} catch (error48) {
|
|
@@ -231775,7 +231684,7 @@ async function getSiteFilePaths(outputDir) {
|
|
|
231775
231684
|
// src/core/site/deploy.ts
|
|
231776
231685
|
import { randomUUID } from "node:crypto";
|
|
231777
231686
|
import { tmpdir } from "node:os";
|
|
231778
|
-
import { join as
|
|
231687
|
+
import { join as join9 } from "node:path";
|
|
231779
231688
|
async function deploySite(siteOutputDir) {
|
|
231780
231689
|
if (!await pathExists(siteOutputDir)) {
|
|
231781
231690
|
throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
|
|
@@ -231792,7 +231701,7 @@ async function deploySite(siteOutputDir) {
|
|
|
231792
231701
|
]
|
|
231793
231702
|
});
|
|
231794
231703
|
}
|
|
231795
|
-
const archivePath =
|
|
231704
|
+
const archivePath = join9(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
|
|
231796
231705
|
try {
|
|
231797
231706
|
await createArchive(siteOutputDir, archivePath);
|
|
231798
231707
|
return await uploadSite(archivePath);
|
|
@@ -239481,7 +239390,7 @@ function getDashboardUrl(projectId) {
|
|
|
239481
239390
|
async function pullAgentsAction() {
|
|
239482
239391
|
const { project: project2 } = await readProjectConfig();
|
|
239483
239392
|
const configDir = dirname7(project2.configPath);
|
|
239484
|
-
const agentsDir =
|
|
239393
|
+
const agentsDir = join10(configDir, project2.agentsDir);
|
|
239485
239394
|
const remoteAgents = await runTask("Fetching agents from Base44", async () => {
|
|
239486
239395
|
return await fetchAgents();
|
|
239487
239396
|
}, {
|
|
@@ -239575,11 +239484,11 @@ function getWhoamiCommand(context) {
|
|
|
239575
239484
|
}
|
|
239576
239485
|
|
|
239577
239486
|
// src/cli/commands/connectors/pull.ts
|
|
239578
|
-
import { dirname as dirname8, join as
|
|
239487
|
+
import { dirname as dirname8, join as join11 } from "node:path";
|
|
239579
239488
|
async function pullConnectorsAction() {
|
|
239580
239489
|
const { project: project2 } = await readProjectConfig();
|
|
239581
239490
|
const configDir = dirname8(project2.configPath);
|
|
239582
|
-
const connectorsDir =
|
|
239491
|
+
const connectorsDir = join11(configDir, project2.connectorsDir);
|
|
239583
239492
|
const remoteConnectors = await runTask("Fetching connectors from Base44", async () => {
|
|
239584
239493
|
return await listConnectors();
|
|
239585
239494
|
}, {
|
|
@@ -240459,63 +240368,14 @@ async function deployFunctionsAction() {
|
|
|
240459
240368
|
}
|
|
240460
240369
|
return { outroMessage: "Functions deployed to Base44" };
|
|
240461
240370
|
}
|
|
240462
|
-
function
|
|
240463
|
-
return new Command("deploy").description("Deploy local functions to Base44").action(async () => {
|
|
240371
|
+
function getFunctionsDeployCommand(context) {
|
|
240372
|
+
return new Command("functions").description("Manage project functions").addCommand(new Command("deploy").description("Deploy local functions to Base44").action(async () => {
|
|
240464
240373
|
await runCommand(deployFunctionsAction, { requireAuth: true }, context);
|
|
240465
|
-
});
|
|
240466
|
-
}
|
|
240467
|
-
|
|
240468
|
-
// src/cli/commands/functions/pull.ts
|
|
240469
|
-
import { dirname as dirname9, join as join13 } from "node:path";
|
|
240470
|
-
async function pullFunctionsAction(name2) {
|
|
240471
|
-
const { project: project2 } = await readProjectConfig();
|
|
240472
|
-
const configDir = dirname9(project2.configPath);
|
|
240473
|
-
const functionsDir = join13(configDir, project2.functionsDir);
|
|
240474
|
-
const remoteFunctions = await runTask("Fetching functions from Base44", async () => {
|
|
240475
|
-
const { functions } = await listDeployedFunctions();
|
|
240476
|
-
return functions;
|
|
240477
|
-
}, {
|
|
240478
|
-
successMessage: "Functions fetched successfully",
|
|
240479
|
-
errorMessage: "Failed to fetch functions"
|
|
240480
|
-
});
|
|
240481
|
-
const toPull = name2 ? remoteFunctions.filter((f) => f.name === name2) : remoteFunctions;
|
|
240482
|
-
if (name2 && toPull.length === 0) {
|
|
240483
|
-
return {
|
|
240484
|
-
outroMessage: `Function "${name2}" not found on remote`
|
|
240485
|
-
};
|
|
240486
|
-
}
|
|
240487
|
-
if (toPull.length === 0) {
|
|
240488
|
-
return { outroMessage: "No functions found on remote" };
|
|
240489
|
-
}
|
|
240490
|
-
const { written, skipped } = await runTask("Writing function files", async () => {
|
|
240491
|
-
return await writeFunctions(functionsDir, toPull);
|
|
240492
|
-
}, {
|
|
240493
|
-
successMessage: "Function files written successfully",
|
|
240494
|
-
errorMessage: "Failed to write function files"
|
|
240495
|
-
});
|
|
240496
|
-
for (const name3 of written) {
|
|
240497
|
-
R2.success(`${name3.padEnd(25)} written`);
|
|
240498
|
-
}
|
|
240499
|
-
for (const name3 of skipped) {
|
|
240500
|
-
R2.info(`${name3.padEnd(25)} unchanged`);
|
|
240501
|
-
}
|
|
240502
|
-
return {
|
|
240503
|
-
outroMessage: `Pulled ${toPull.length} function${toPull.length !== 1 ? "s" : ""} to ${functionsDir}`
|
|
240504
|
-
};
|
|
240505
|
-
}
|
|
240506
|
-
function getPullCommand(context) {
|
|
240507
|
-
return new Command("pull").description("Pull deployed functions from Base44").argument("[name]", "Pull a single function by name").action(async (name2) => {
|
|
240508
|
-
await runCommand(() => pullFunctionsAction(name2), { requireAuth: true }, context);
|
|
240509
|
-
});
|
|
240510
|
-
}
|
|
240511
|
-
|
|
240512
|
-
// src/cli/commands/functions/index.ts
|
|
240513
|
-
function getFunctionsCommand(context) {
|
|
240514
|
-
return new Command("functions").description("Manage backend functions").addCommand(getDeployCommand(context)).addCommand(getPullCommand(context));
|
|
240374
|
+
}));
|
|
240515
240375
|
}
|
|
240516
240376
|
|
|
240517
240377
|
// src/cli/commands/project/create.ts
|
|
240518
|
-
import { basename as basename3, join as
|
|
240378
|
+
import { basename as basename3, join as join12, resolve as resolve2 } from "node:path";
|
|
240519
240379
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
240520
240380
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
240521
240381
|
async function getTemplateById(templateId) {
|
|
@@ -240651,7 +240511,7 @@ async function executeCreate({
|
|
|
240651
240511
|
updateMessage("Building project...");
|
|
240652
240512
|
await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
|
|
240653
240513
|
updateMessage("Deploying site...");
|
|
240654
|
-
return await deploySite(
|
|
240514
|
+
return await deploySite(join12(resolvedPath, outputDirectory));
|
|
240655
240515
|
}, {
|
|
240656
240516
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
240657
240517
|
errorMessage: "Failed to deploy site"
|
|
@@ -240753,7 +240613,7 @@ ${summaryLines.join(`
|
|
|
240753
240613
|
}
|
|
240754
240614
|
return { outroMessage: "App deployed successfully" };
|
|
240755
240615
|
}
|
|
240756
|
-
function
|
|
240616
|
+
function getDeployCommand(context) {
|
|
240757
240617
|
return new Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
|
|
240758
240618
|
await runCommand(() => deployAction({
|
|
240759
240619
|
...options,
|
|
@@ -241277,10 +241137,10 @@ function toPascalCase(name2) {
|
|
|
241277
241137
|
return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
|
|
241278
241138
|
}
|
|
241279
241139
|
// src/core/types/update-project.ts
|
|
241280
|
-
import { join as
|
|
241140
|
+
import { join as join15 } from "node:path";
|
|
241281
241141
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
241282
241142
|
async function updateProjectConfig(projectRoot) {
|
|
241283
|
-
const tsconfigPath =
|
|
241143
|
+
const tsconfigPath = join15(projectRoot, "tsconfig.json");
|
|
241284
241144
|
if (!await pathExists(tsconfigPath)) {
|
|
241285
241145
|
return false;
|
|
241286
241146
|
}
|
|
@@ -241323,7 +241183,7 @@ function getTypesCommand(context) {
|
|
|
241323
241183
|
}
|
|
241324
241184
|
|
|
241325
241185
|
// src/cli/dev/dev-server/main.ts
|
|
241326
|
-
import { dirname as
|
|
241186
|
+
import { dirname as dirname13, join as join18 } from "node:path";
|
|
241327
241187
|
var import_cors = __toESM(require_lib4(), 1);
|
|
241328
241188
|
var import_express4 = __toESM(require_express(), 1);
|
|
241329
241189
|
|
|
@@ -242787,9 +242647,9 @@ class NodeFsHandler {
|
|
|
242787
242647
|
if (this.fsw.closed) {
|
|
242788
242648
|
return;
|
|
242789
242649
|
}
|
|
242790
|
-
const
|
|
242650
|
+
const dirname12 = sp2.dirname(file2);
|
|
242791
242651
|
const basename5 = sp2.basename(file2);
|
|
242792
|
-
const parent = this.fsw._getWatchedDir(
|
|
242652
|
+
const parent = this.fsw._getWatchedDir(dirname12);
|
|
242793
242653
|
let prevStats = stats;
|
|
242794
242654
|
if (parent.has(basename5))
|
|
242795
242655
|
return;
|
|
@@ -242816,7 +242676,7 @@ class NodeFsHandler {
|
|
|
242816
242676
|
prevStats = newStats2;
|
|
242817
242677
|
}
|
|
242818
242678
|
} catch (error48) {
|
|
242819
|
-
this.fsw._remove(
|
|
242679
|
+
this.fsw._remove(dirname12, basename5);
|
|
242820
242680
|
}
|
|
242821
242681
|
} else if (parent.has(basename5)) {
|
|
242822
242682
|
const at13 = newStats.atimeMs;
|
|
@@ -243819,8 +243679,8 @@ async function createDevServer(options8) {
|
|
|
243819
243679
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
243820
243680
|
};
|
|
243821
243681
|
const base44ConfigWatcher = new WatchBase44({
|
|
243822
|
-
functions:
|
|
243823
|
-
entities:
|
|
243682
|
+
functions: join18(dirname13(project2.configPath), project2.functionsDir),
|
|
243683
|
+
entities: join18(dirname13(project2.configPath), project2.entitiesDir)
|
|
243824
243684
|
}, devLogger);
|
|
243825
243685
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
243826
243686
|
try {
|
|
@@ -243990,13 +243850,13 @@ function createProgram(context) {
|
|
|
243990
243850
|
program2.addCommand(getLogoutCommand(context));
|
|
243991
243851
|
program2.addCommand(getCreateCommand(context));
|
|
243992
243852
|
program2.addCommand(getDashboardCommand(context));
|
|
243993
|
-
program2.addCommand(
|
|
243853
|
+
program2.addCommand(getDeployCommand(context));
|
|
243994
243854
|
program2.addCommand(getLinkCommand(context));
|
|
243995
243855
|
program2.addCommand(getEjectCommand(context));
|
|
243996
243856
|
program2.addCommand(getEntitiesPushCommand(context));
|
|
243997
243857
|
program2.addCommand(getAgentsCommand(context));
|
|
243998
243858
|
program2.addCommand(getConnectorsCommand(context));
|
|
243999
|
-
program2.addCommand(
|
|
243859
|
+
program2.addCommand(getFunctionsDeployCommand(context));
|
|
244000
243860
|
program2.addCommand(getSecretsCommand(context));
|
|
244001
243861
|
program2.addCommand(getSiteCommand(context));
|
|
244002
243862
|
program2.addCommand(getTypesCommand(context));
|
|
@@ -244010,7 +243870,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
244010
243870
|
import { release, type } from "node:os";
|
|
244011
243871
|
|
|
244012
243872
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
244013
|
-
import { dirname as
|
|
243873
|
+
import { dirname as dirname14, posix, sep } from "path";
|
|
244014
243874
|
function createModulerModifier() {
|
|
244015
243875
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
244016
243876
|
return async (frames) => {
|
|
@@ -244019,7 +243879,7 @@ function createModulerModifier() {
|
|
|
244019
243879
|
return frames;
|
|
244020
243880
|
};
|
|
244021
243881
|
}
|
|
244022
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
243882
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname14(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
244023
243883
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
244024
243884
|
return (filename) => {
|
|
244025
243885
|
if (!filename)
|
|
@@ -248208,9 +248068,9 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
|
|
|
248208
248068
|
});
|
|
248209
248069
|
}
|
|
248210
248070
|
// src/cli/index.ts
|
|
248211
|
-
var __dirname4 =
|
|
248071
|
+
var __dirname4 = dirname15(fileURLToPath6(import.meta.url));
|
|
248212
248072
|
async function runCLI() {
|
|
248213
|
-
ensureNpmAssets(
|
|
248073
|
+
ensureNpmAssets(join19(__dirname4, "../assets"));
|
|
248214
248074
|
const errorReporter = new ErrorReporter;
|
|
248215
248075
|
errorReporter.registerProcessErrorHandlers();
|
|
248216
248076
|
const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
|
|
@@ -248242,4 +248102,4 @@ export {
|
|
|
248242
248102
|
CLIExitError
|
|
248243
248103
|
};
|
|
248244
248104
|
|
|
248245
|
-
//# debugId=
|
|
248105
|
+
//# debugId=C89811ECE434F70F64756E2164756E21
|