@base44-preview/cli 0.0.40-pr.380.5d40f28 → 0.0.40-pr.382.07e2a4c
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 +155 -71
- package/dist/cli/index.js.map +7 -6
- package/package.json +1 -1
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 join15(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 pull2 = 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 = pull2;
|
|
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 = join15;
|
|
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" ? join15(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 join15(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: join15,
|
|
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" ? join17(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 join17(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: join17,
|
|
127061
127061
|
line: line3,
|
|
127062
127062
|
softline: softline2,
|
|
127063
127063
|
hardline: hardline4,
|
|
@@ -156272,10 +156272,10 @@ var require_view = __commonJS((exports, module) => {
|
|
|
156272
156272
|
var debug = require_src4()("express:view");
|
|
156273
156273
|
var path18 = __require("node:path");
|
|
156274
156274
|
var fs28 = __require("node:fs");
|
|
156275
|
-
var
|
|
156275
|
+
var dirname12 = path18.dirname;
|
|
156276
156276
|
var basename4 = path18.basename;
|
|
156277
156277
|
var extname2 = path18.extname;
|
|
156278
|
-
var
|
|
156278
|
+
var join18 = path18.join;
|
|
156279
156279
|
var resolve6 = path18.resolve;
|
|
156280
156280
|
module.exports = View;
|
|
156281
156281
|
function View(name2, options8) {
|
|
@@ -156311,7 +156311,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
156311
156311
|
for (var i5 = 0;i5 < roots.length && !path19; i5++) {
|
|
156312
156312
|
var root2 = roots[i5];
|
|
156313
156313
|
var loc = resolve6(root2, name2);
|
|
156314
|
-
var dir =
|
|
156314
|
+
var dir = dirname12(loc);
|
|
156315
156315
|
var file2 = basename4(loc);
|
|
156316
156316
|
path19 = this.resolve(dir, file2);
|
|
156317
156317
|
}
|
|
@@ -156337,12 +156337,12 @@ var require_view = __commonJS((exports, module) => {
|
|
|
156337
156337
|
};
|
|
156338
156338
|
View.prototype.resolve = function resolve7(dir, file2) {
|
|
156339
156339
|
var ext = this.ext;
|
|
156340
|
-
var path19 =
|
|
156340
|
+
var path19 = join18(dir, file2);
|
|
156341
156341
|
var stat2 = tryStat(path19);
|
|
156342
156342
|
if (stat2 && stat2.isFile()) {
|
|
156343
156343
|
return path19;
|
|
156344
156344
|
}
|
|
156345
|
-
path19 =
|
|
156345
|
+
path19 = join18(dir, basename4(file2, ext), "index" + ext);
|
|
156346
156346
|
stat2 = tryStat(path19);
|
|
156347
156347
|
if (stat2 && stat2.isFile()) {
|
|
156348
156348
|
return path19;
|
|
@@ -160037,7 +160037,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
160037
160037
|
var Stream2 = __require("stream");
|
|
160038
160038
|
var util2 = __require("util");
|
|
160039
160039
|
var extname2 = path18.extname;
|
|
160040
|
-
var
|
|
160040
|
+
var join18 = path18.join;
|
|
160041
160041
|
var normalize = path18.normalize;
|
|
160042
160042
|
var resolve6 = path18.resolve;
|
|
160043
160043
|
var sep = path18.sep;
|
|
@@ -160209,7 +160209,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
160209
160209
|
return res;
|
|
160210
160210
|
}
|
|
160211
160211
|
parts = path19.split(sep);
|
|
160212
|
-
path19 = normalize(
|
|
160212
|
+
path19 = normalize(join18(root2, path19));
|
|
160213
160213
|
} else {
|
|
160214
160214
|
if (UP_PATH_REGEXP.test(path19)) {
|
|
160215
160215
|
debug('malicious path "%s"', path19);
|
|
@@ -160349,7 +160349,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
160349
160349
|
return self2.onStatError(err);
|
|
160350
160350
|
return self2.error(404);
|
|
160351
160351
|
}
|
|
160352
|
-
var p4 =
|
|
160352
|
+
var p4 = join18(path19, self2._index[i5]);
|
|
160353
160353
|
debug('stat "%s"', p4);
|
|
160354
160354
|
fs28.stat(p4, function(err2, stat2) {
|
|
160355
160355
|
if (err2)
|
|
@@ -206944,7 +206944,7 @@ var require_buffer_list = __commonJS((exports, module) => {
|
|
|
206944
206944
|
}
|
|
206945
206945
|
}, {
|
|
206946
206946
|
key: "join",
|
|
206947
|
-
value: function
|
|
206947
|
+
value: function join18(s5) {
|
|
206948
206948
|
if (this.length === 0)
|
|
206949
206949
|
return "";
|
|
206950
206950
|
var p4 = this.head;
|
|
@@ -210655,7 +210655,7 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
210655
210655
|
});
|
|
210656
210656
|
|
|
210657
210657
|
// src/cli/index.ts
|
|
210658
|
-
import { dirname as
|
|
210658
|
+
import { dirname as dirname16, join as join21 } from "node:path";
|
|
210659
210659
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
210660
210660
|
|
|
210661
210661
|
// node_modules/commander/esm.mjs
|
|
@@ -210675,7 +210675,7 @@ var {
|
|
|
210675
210675
|
} = import__.default;
|
|
210676
210676
|
|
|
210677
210677
|
// src/cli/commands/agents/pull.ts
|
|
210678
|
-
import { dirname as dirname7, join as
|
|
210678
|
+
import { dirname as dirname7, join as join11 } from "node:path";
|
|
210679
210679
|
|
|
210680
210680
|
// node_modules/@clack/core/dist/index.mjs
|
|
210681
210681
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
@@ -233171,7 +233171,7 @@ var generateGlobTasks = normalizeArguments(generateTasks);
|
|
|
233171
233171
|
var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
|
|
233172
233172
|
|
|
233173
233173
|
// src/core/project/config.ts
|
|
233174
|
-
import { dirname as dirname5, join as
|
|
233174
|
+
import { dirname as dirname5, join as join7 } from "node:path";
|
|
233175
233175
|
|
|
233176
233176
|
// src/core/resources/agent/schema.ts
|
|
233177
233177
|
var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
|
|
@@ -234104,6 +234104,67 @@ async function pushFunctions(functions) {
|
|
|
234104
234104
|
const functionsWithCode = await Promise.all(functions.map(loadFunctionCode));
|
|
234105
234105
|
return deployFunctions(functionsWithCode);
|
|
234106
234106
|
}
|
|
234107
|
+
// src/core/resources/function/pull.ts
|
|
234108
|
+
import { join as join6 } from "node:path";
|
|
234109
|
+
async function writeFunctions(functionsDir, functions) {
|
|
234110
|
+
const written = [];
|
|
234111
|
+
const skipped = [];
|
|
234112
|
+
for (const fn of functions) {
|
|
234113
|
+
const functionDir = join6(functionsDir, fn.name);
|
|
234114
|
+
const configPath = join6(functionDir, "function.jsonc");
|
|
234115
|
+
if (await isFunctionUnchanged(functionDir, fn)) {
|
|
234116
|
+
skipped.push(fn.name);
|
|
234117
|
+
continue;
|
|
234118
|
+
}
|
|
234119
|
+
const config5 = {
|
|
234120
|
+
name: fn.name,
|
|
234121
|
+
entry: fn.entry
|
|
234122
|
+
};
|
|
234123
|
+
if (fn.automations.length > 0) {
|
|
234124
|
+
config5.automations = fn.automations;
|
|
234125
|
+
}
|
|
234126
|
+
await writeJsonFile(configPath, config5);
|
|
234127
|
+
for (const file2 of fn.files) {
|
|
234128
|
+
await writeFile(join6(functionDir, file2.path), file2.content);
|
|
234129
|
+
}
|
|
234130
|
+
written.push(fn.name);
|
|
234131
|
+
}
|
|
234132
|
+
return { written, skipped };
|
|
234133
|
+
}
|
|
234134
|
+
async function isFunctionUnchanged(functionDir, fn) {
|
|
234135
|
+
if (!await pathExists(functionDir)) {
|
|
234136
|
+
return false;
|
|
234137
|
+
}
|
|
234138
|
+
const configPath = join6(functionDir, "function.jsonc");
|
|
234139
|
+
try {
|
|
234140
|
+
const localConfig = await readJsonFile(configPath);
|
|
234141
|
+
if (localConfig.entry !== fn.entry) {
|
|
234142
|
+
return false;
|
|
234143
|
+
}
|
|
234144
|
+
const localAuto = JSON.stringify(localConfig.automations ?? []);
|
|
234145
|
+
const remoteAuto = JSON.stringify(fn.automations);
|
|
234146
|
+
if (localAuto !== remoteAuto) {
|
|
234147
|
+
return false;
|
|
234148
|
+
}
|
|
234149
|
+
} catch {
|
|
234150
|
+
return false;
|
|
234151
|
+
}
|
|
234152
|
+
for (const file2 of fn.files) {
|
|
234153
|
+
const filePath = join6(functionDir, file2.path);
|
|
234154
|
+
if (!await pathExists(filePath)) {
|
|
234155
|
+
return false;
|
|
234156
|
+
}
|
|
234157
|
+
try {
|
|
234158
|
+
const localContent = await readTextFile(filePath);
|
|
234159
|
+
if (localContent !== file2.content) {
|
|
234160
|
+
return false;
|
|
234161
|
+
}
|
|
234162
|
+
} catch {
|
|
234163
|
+
return false;
|
|
234164
|
+
}
|
|
234165
|
+
}
|
|
234166
|
+
return true;
|
|
234167
|
+
}
|
|
234107
234168
|
// src/core/resources/function/resource.ts
|
|
234108
234169
|
var functionResource = {
|
|
234109
234170
|
readAll: readAllFunctions,
|
|
@@ -234148,10 +234209,10 @@ async function readProjectConfig(projectRoot) {
|
|
|
234148
234209
|
const project = result.data;
|
|
234149
234210
|
const configDir = dirname5(configPath);
|
|
234150
234211
|
const [entities, functions, agents, connectors] = await Promise.all([
|
|
234151
|
-
entityResource.readAll(
|
|
234152
|
-
functionResource.readAll(
|
|
234153
|
-
agentResource.readAll(
|
|
234154
|
-
connectorResource.readAll(
|
|
234212
|
+
entityResource.readAll(join7(configDir, project.entitiesDir)),
|
|
234213
|
+
functionResource.readAll(join7(configDir, project.functionsDir)),
|
|
234214
|
+
agentResource.readAll(join7(configDir, project.agentsDir)),
|
|
234215
|
+
connectorResource.readAll(join7(configDir, project.connectorsDir))
|
|
234155
234216
|
]);
|
|
234156
234217
|
return {
|
|
234157
234218
|
project: { ...project, root, configPath },
|
|
@@ -234248,12 +234309,12 @@ async function readAppConfig(projectRoot) {
|
|
|
234248
234309
|
// src/core/project/template.ts
|
|
234249
234310
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
234250
234311
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
234251
|
-
import { dirname as dirname6, join as
|
|
234312
|
+
import { dirname as dirname6, join as join9 } from "node:path";
|
|
234252
234313
|
|
|
234253
234314
|
// src/core/assets.ts
|
|
234254
234315
|
import { cpSync, existsSync } from "node:fs";
|
|
234255
234316
|
import { homedir as homedir2 } from "node:os";
|
|
234256
|
-
import { join as
|
|
234317
|
+
import { join as join8 } from "node:path";
|
|
234257
234318
|
// package.json
|
|
234258
234319
|
var package_default = {
|
|
234259
234320
|
name: "base44",
|
|
@@ -234348,15 +234409,15 @@ var package_default = {
|
|
|
234348
234409
|
};
|
|
234349
234410
|
|
|
234350
234411
|
// src/core/assets.ts
|
|
234351
|
-
var ASSETS_DIR =
|
|
234412
|
+
var ASSETS_DIR = join8(homedir2(), ".base44", "assets", package_default.version);
|
|
234352
234413
|
function getTemplatesDir() {
|
|
234353
|
-
return
|
|
234414
|
+
return join8(ASSETS_DIR, "templates");
|
|
234354
234415
|
}
|
|
234355
234416
|
function getTemplatesIndexPath() {
|
|
234356
|
-
return
|
|
234417
|
+
return join8(ASSETS_DIR, "templates", "templates.json");
|
|
234357
234418
|
}
|
|
234358
234419
|
function getDenoWrapperPath() {
|
|
234359
|
-
return
|
|
234420
|
+
return join8(ASSETS_DIR, "deno-runtime", "main.js");
|
|
234360
234421
|
}
|
|
234361
234422
|
function ensureNpmAssets(sourceDir) {
|
|
234362
234423
|
if (existsSync(ASSETS_DIR))
|
|
@@ -234377,23 +234438,23 @@ async function listTemplates() {
|
|
|
234377
234438
|
return result.data.templates;
|
|
234378
234439
|
}
|
|
234379
234440
|
async function renderTemplate(template, destPath, data) {
|
|
234380
|
-
const templateDir =
|
|
234441
|
+
const templateDir = join9(getTemplatesDir(), template.path);
|
|
234381
234442
|
const files = await globby("**/*", {
|
|
234382
234443
|
cwd: templateDir,
|
|
234383
234444
|
dot: true,
|
|
234384
234445
|
onlyFiles: true
|
|
234385
234446
|
});
|
|
234386
234447
|
for (const file2 of files) {
|
|
234387
|
-
const srcPath =
|
|
234448
|
+
const srcPath = join9(templateDir, file2);
|
|
234388
234449
|
try {
|
|
234389
234450
|
if (file2.endsWith(".ejs")) {
|
|
234390
234451
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
234391
234452
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
234392
|
-
const destFile = attributes.outputFileName ?
|
|
234393
|
-
const destFilePath =
|
|
234453
|
+
const destFile = attributes.outputFileName ? join9(dirname6(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
234454
|
+
const destFilePath = join9(destPath, destFile);
|
|
234394
234455
|
await writeFile(destFilePath, body);
|
|
234395
234456
|
} else {
|
|
234396
|
-
const destFilePath =
|
|
234457
|
+
const destFilePath = join9(destPath, file2);
|
|
234397
234458
|
await copyFile(srcPath, destFilePath);
|
|
234398
234459
|
}
|
|
234399
234460
|
} catch (error48) {
|
|
@@ -234492,7 +234553,7 @@ async function getSiteFilePaths(outputDir) {
|
|
|
234492
234553
|
// src/core/site/deploy.ts
|
|
234493
234554
|
import { randomUUID } from "node:crypto";
|
|
234494
234555
|
import { tmpdir } from "node:os";
|
|
234495
|
-
import { join as
|
|
234556
|
+
import { join as join10 } from "node:path";
|
|
234496
234557
|
async function deploySite(siteOutputDir) {
|
|
234497
234558
|
if (!await pathExists(siteOutputDir)) {
|
|
234498
234559
|
throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
|
|
@@ -234509,7 +234570,7 @@ async function deploySite(siteOutputDir) {
|
|
|
234509
234570
|
]
|
|
234510
234571
|
});
|
|
234511
234572
|
}
|
|
234512
|
-
const archivePath =
|
|
234573
|
+
const archivePath = join10(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
|
|
234513
234574
|
try {
|
|
234514
234575
|
await createArchive(siteOutputDir, archivePath);
|
|
234515
234576
|
return await uploadSite(archivePath);
|
|
@@ -242198,7 +242259,7 @@ function getDashboardUrl(projectId) {
|
|
|
242198
242259
|
async function pullAgentsAction() {
|
|
242199
242260
|
const { project: project2 } = await readProjectConfig();
|
|
242200
242261
|
const configDir = dirname7(project2.configPath);
|
|
242201
|
-
const agentsDir =
|
|
242262
|
+
const agentsDir = join11(configDir, project2.agentsDir);
|
|
242202
242263
|
const remoteAgents = await runTask("Fetching agents from Base44", async () => {
|
|
242203
242264
|
return await fetchAgents();
|
|
242204
242265
|
}, {
|
|
@@ -242292,11 +242353,11 @@ function getWhoamiCommand(context) {
|
|
|
242292
242353
|
}
|
|
242293
242354
|
|
|
242294
242355
|
// src/cli/commands/connectors/pull.ts
|
|
242295
|
-
import { dirname as dirname8, join as
|
|
242356
|
+
import { dirname as dirname8, join as join12 } from "node:path";
|
|
242296
242357
|
async function pullConnectorsAction() {
|
|
242297
242358
|
const { project: project2 } = await readProjectConfig();
|
|
242298
242359
|
const configDir = dirname8(project2.configPath);
|
|
242299
|
-
const connectorsDir =
|
|
242360
|
+
const connectorsDir = join12(configDir, project2.connectorsDir);
|
|
242300
242361
|
const remoteConnectors = await runTask("Fetching connectors from Base44", async () => {
|
|
242301
242362
|
return await listConnectors();
|
|
242302
242363
|
}, {
|
|
@@ -243182,34 +243243,57 @@ function getDeployCommand(context) {
|
|
|
243182
243243
|
});
|
|
243183
243244
|
}
|
|
243184
243245
|
|
|
243185
|
-
// src/cli/commands/functions/
|
|
243186
|
-
|
|
243187
|
-
|
|
243188
|
-
|
|
243189
|
-
|
|
243246
|
+
// src/cli/commands/functions/pull.ts
|
|
243247
|
+
import { dirname as dirname9, join as join13 } from "node:path";
|
|
243248
|
+
async function pullFunctionsAction(name2) {
|
|
243249
|
+
const { project: project2 } = await readProjectConfig();
|
|
243250
|
+
const configDir = dirname9(project2.configPath);
|
|
243251
|
+
const functionsDir = join13(configDir, project2.functionsDir);
|
|
243252
|
+
const remoteFunctions = await runTask("Fetching functions from Base44", async () => {
|
|
243253
|
+
const { functions } = await listDeployedFunctions();
|
|
243254
|
+
return functions;
|
|
243255
|
+
}, {
|
|
243256
|
+
successMessage: "Functions fetched successfully",
|
|
243257
|
+
errorMessage: "Failed to fetch functions"
|
|
243258
|
+
});
|
|
243259
|
+
const toPull = name2 ? remoteFunctions.filter((f) => f.name === name2) : remoteFunctions;
|
|
243260
|
+
if (name2 && toPull.length === 0) {
|
|
243261
|
+
return {
|
|
243262
|
+
outroMessage: `Function "${name2}" not found on remote`
|
|
243263
|
+
};
|
|
243190
243264
|
}
|
|
243191
|
-
|
|
243192
|
-
|
|
243193
|
-
|
|
243194
|
-
|
|
243265
|
+
if (toPull.length === 0) {
|
|
243266
|
+
return { outroMessage: "No functions found on remote" };
|
|
243267
|
+
}
|
|
243268
|
+
const { written, skipped } = await runTask("Writing function files", async () => {
|
|
243269
|
+
return await writeFunctions(functionsDir, toPull);
|
|
243270
|
+
}, {
|
|
243271
|
+
successMessage: "Function files written successfully",
|
|
243272
|
+
errorMessage: "Failed to write function files"
|
|
243273
|
+
});
|
|
243274
|
+
for (const name3 of written) {
|
|
243275
|
+
R2.success(`${name3.padEnd(25)} written`);
|
|
243276
|
+
}
|
|
243277
|
+
for (const name3 of skipped) {
|
|
243278
|
+
R2.info(`${name3.padEnd(25)} unchanged`);
|
|
243195
243279
|
}
|
|
243196
243280
|
return {
|
|
243197
|
-
outroMessage:
|
|
243281
|
+
outroMessage: `Pulled ${toPull.length} function${toPull.length !== 1 ? "s" : ""} to ${functionsDir}`
|
|
243198
243282
|
};
|
|
243199
243283
|
}
|
|
243200
|
-
function
|
|
243201
|
-
return new Command("
|
|
243202
|
-
await runCommand(
|
|
243284
|
+
function getPullCommand(context) {
|
|
243285
|
+
return new Command("pull").description("Pull deployed functions from Base44").argument("[name]", "Pull a single function by name").action(async (name2) => {
|
|
243286
|
+
await runCommand(() => pullFunctionsAction(name2), { requireAuth: true }, context);
|
|
243203
243287
|
});
|
|
243204
243288
|
}
|
|
243205
243289
|
|
|
243206
243290
|
// src/cli/commands/functions/index.ts
|
|
243207
243291
|
function getFunctionsCommand(context) {
|
|
243208
|
-
return new Command("functions").description("Manage backend functions").addCommand(getDeployCommand(context)).addCommand(
|
|
243292
|
+
return new Command("functions").description("Manage backend functions").addCommand(getDeployCommand(context)).addCommand(getPullCommand(context));
|
|
243209
243293
|
}
|
|
243210
243294
|
|
|
243211
243295
|
// src/cli/commands/project/create.ts
|
|
243212
|
-
import { basename as basename3, join as
|
|
243296
|
+
import { basename as basename3, join as join14, resolve as resolve2 } from "node:path";
|
|
243213
243297
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
243214
243298
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
243215
243299
|
async function getTemplateById(templateId) {
|
|
@@ -243345,7 +243429,7 @@ async function executeCreate({
|
|
|
243345
243429
|
updateMessage("Building project...");
|
|
243346
243430
|
await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
|
|
243347
243431
|
updateMessage("Deploying site...");
|
|
243348
|
-
return await deploySite(
|
|
243432
|
+
return await deploySite(join14(resolvedPath, outputDirectory));
|
|
243349
243433
|
}, {
|
|
243350
243434
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
243351
243435
|
errorMessage: "Failed to deploy site"
|
|
@@ -243971,10 +244055,10 @@ function toPascalCase(name2) {
|
|
|
243971
244055
|
return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
|
|
243972
244056
|
}
|
|
243973
244057
|
// src/core/types/update-project.ts
|
|
243974
|
-
import { join as
|
|
244058
|
+
import { join as join17 } from "node:path";
|
|
243975
244059
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
243976
244060
|
async function updateProjectConfig(projectRoot) {
|
|
243977
|
-
const tsconfigPath =
|
|
244061
|
+
const tsconfigPath = join17(projectRoot, "tsconfig.json");
|
|
243978
244062
|
if (!await pathExists(tsconfigPath)) {
|
|
243979
244063
|
return false;
|
|
243980
244064
|
}
|
|
@@ -244017,7 +244101,7 @@ function getTypesCommand(context) {
|
|
|
244017
244101
|
}
|
|
244018
244102
|
|
|
244019
244103
|
// src/cli/dev/dev-server/main.ts
|
|
244020
|
-
import { dirname as
|
|
244104
|
+
import { dirname as dirname14, join as join20 } from "node:path";
|
|
244021
244105
|
var import_cors = __toESM(require_lib4(), 1);
|
|
244022
244106
|
var import_express4 = __toESM(require_express(), 1);
|
|
244023
244107
|
|
|
@@ -245481,9 +245565,9 @@ class NodeFsHandler {
|
|
|
245481
245565
|
if (this.fsw.closed) {
|
|
245482
245566
|
return;
|
|
245483
245567
|
}
|
|
245484
|
-
const
|
|
245568
|
+
const dirname13 = sp2.dirname(file2);
|
|
245485
245569
|
const basename5 = sp2.basename(file2);
|
|
245486
|
-
const parent = this.fsw._getWatchedDir(
|
|
245570
|
+
const parent = this.fsw._getWatchedDir(dirname13);
|
|
245487
245571
|
let prevStats = stats;
|
|
245488
245572
|
if (parent.has(basename5))
|
|
245489
245573
|
return;
|
|
@@ -245510,7 +245594,7 @@ class NodeFsHandler {
|
|
|
245510
245594
|
prevStats = newStats2;
|
|
245511
245595
|
}
|
|
245512
245596
|
} catch (error48) {
|
|
245513
|
-
this.fsw._remove(
|
|
245597
|
+
this.fsw._remove(dirname13, basename5);
|
|
245514
245598
|
}
|
|
245515
245599
|
} else if (parent.has(basename5)) {
|
|
245516
245600
|
const at13 = newStats.atimeMs;
|
|
@@ -246513,8 +246597,8 @@ async function createDevServer(options8) {
|
|
|
246513
246597
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
246514
246598
|
};
|
|
246515
246599
|
const base44ConfigWatcher = new WatchBase44({
|
|
246516
|
-
functions:
|
|
246517
|
-
entities:
|
|
246600
|
+
functions: join20(dirname14(project2.configPath), project2.functionsDir),
|
|
246601
|
+
entities: join20(dirname14(project2.configPath), project2.entitiesDir)
|
|
246518
246602
|
}, devLogger);
|
|
246519
246603
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
246520
246604
|
try {
|
|
@@ -246704,7 +246788,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
246704
246788
|
import { release, type } from "node:os";
|
|
246705
246789
|
|
|
246706
246790
|
// node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
246707
|
-
import { dirname as
|
|
246791
|
+
import { dirname as dirname15, posix, sep } from "path";
|
|
246708
246792
|
function createModulerModifier() {
|
|
246709
246793
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
246710
246794
|
return async (frames) => {
|
|
@@ -246713,7 +246797,7 @@ function createModulerModifier() {
|
|
|
246713
246797
|
return frames;
|
|
246714
246798
|
};
|
|
246715
246799
|
}
|
|
246716
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
246800
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname15(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
246717
246801
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
246718
246802
|
return (filename) => {
|
|
246719
246803
|
if (!filename)
|
|
@@ -250902,9 +250986,9 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
|
|
|
250902
250986
|
});
|
|
250903
250987
|
}
|
|
250904
250988
|
// src/cli/index.ts
|
|
250905
|
-
var __dirname4 =
|
|
250989
|
+
var __dirname4 = dirname16(fileURLToPath6(import.meta.url));
|
|
250906
250990
|
async function runCLI() {
|
|
250907
|
-
ensureNpmAssets(
|
|
250991
|
+
ensureNpmAssets(join21(__dirname4, "../assets"));
|
|
250908
250992
|
const errorReporter = new ErrorReporter;
|
|
250909
250993
|
errorReporter.registerProcessErrorHandlers();
|
|
250910
250994
|
const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
|
|
@@ -250936,4 +251020,4 @@ export {
|
|
|
250936
251020
|
CLIExitError
|
|
250937
251021
|
};
|
|
250938
251022
|
|
|
250939
|
-
//# debugId=
|
|
251023
|
+
//# debugId=F91D0DB4151EAA5F64756E2164756E21
|