@base44-preview/cli 0.0.44-pr.380.71fe077 → 0.0.44-pr.382.6bffbd1
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 +162 -58
- package/dist/cli/index.js.map +7 -5
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -16459,7 +16459,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
|
16459
16459
|
}
|
|
16460
16460
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
|
|
16461
16461
|
});
|
|
16462
|
-
function
|
|
16462
|
+
function join11(array2, separator) {
|
|
16463
16463
|
return array2 == null ? "" : nativeJoin.call(array2, separator);
|
|
16464
16464
|
}
|
|
16465
16465
|
function last(array2) {
|
|
@@ -16481,7 +16481,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
|
16481
16481
|
function nth(array2, n2) {
|
|
16482
16482
|
return array2 && array2.length ? baseNth(array2, toInteger(n2)) : undefined2;
|
|
16483
16483
|
}
|
|
16484
|
-
var
|
|
16484
|
+
var pull3 = baseRest(pullAll);
|
|
16485
16485
|
function pullAll(array2, values2) {
|
|
16486
16486
|
return array2 && array2.length && values2 && values2.length ? basePullAll(array2, values2) : array2;
|
|
16487
16487
|
}
|
|
@@ -18246,7 +18246,7 @@ __p += '`;
|
|
|
18246
18246
|
lodash.pickBy = pickBy;
|
|
18247
18247
|
lodash.property = property;
|
|
18248
18248
|
lodash.propertyOf = propertyOf;
|
|
18249
|
-
lodash.pull =
|
|
18249
|
+
lodash.pull = pull3;
|
|
18250
18250
|
lodash.pullAll = pullAll;
|
|
18251
18251
|
lodash.pullAllBy = pullAllBy;
|
|
18252
18252
|
lodash.pullAllWith = pullAllWith;
|
|
@@ -18391,7 +18391,7 @@ __p += '`;
|
|
|
18391
18391
|
lodash.isUndefined = isUndefined;
|
|
18392
18392
|
lodash.isWeakMap = isWeakMap;
|
|
18393
18393
|
lodash.isWeakSet = isWeakSet;
|
|
18394
|
-
lodash.join =
|
|
18394
|
+
lodash.join = join11;
|
|
18395
18395
|
lodash.kebabCase = kebabCase;
|
|
18396
18396
|
lodash.last = last;
|
|
18397
18397
|
lodash.lastIndexOf = lastIndexOf;
|
|
@@ -27503,7 +27503,7 @@ function cleanDoc(doc2) {
|
|
|
27503
27503
|
return mapDoc(doc2, (currentDoc) => cleanDocFn(currentDoc));
|
|
27504
27504
|
}
|
|
27505
27505
|
function replaceEndOfLine(doc2, replacement = literalline) {
|
|
27506
|
-
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ?
|
|
27506
|
+
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ? join15(replacement, currentDoc.split(`
|
|
27507
27507
|
`)) : currentDoc);
|
|
27508
27508
|
}
|
|
27509
27509
|
function canBreakFn(doc2) {
|
|
@@ -27583,7 +27583,7 @@ function indentIfBreak(contents, options) {
|
|
|
27583
27583
|
negate: options.negate
|
|
27584
27584
|
};
|
|
27585
27585
|
}
|
|
27586
|
-
function
|
|
27586
|
+
function join15(separator, docs) {
|
|
27587
27587
|
assertDoc(separator);
|
|
27588
27588
|
assertDocArray(docs);
|
|
27589
27589
|
const parts = [];
|
|
@@ -28294,7 +28294,7 @@ var init_doc = __esm(() => {
|
|
|
28294
28294
|
MODE_FLAT = Symbol("MODE_FLAT");
|
|
28295
28295
|
DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
28296
28296
|
builders = {
|
|
28297
|
-
join:
|
|
28297
|
+
join: join15,
|
|
28298
28298
|
line,
|
|
28299
28299
|
softline,
|
|
28300
28300
|
hardline,
|
|
@@ -133208,7 +133208,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
133208
133208
|
return mapDoc2(doc2, (currentDoc) => cleanDocFn2(currentDoc));
|
|
133209
133209
|
}
|
|
133210
133210
|
function replaceEndOfLine2(doc2, replacement = literalline2) {
|
|
133211
|
-
return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ?
|
|
133211
|
+
return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ? join17(replacement, currentDoc.split(`
|
|
133212
133212
|
`)) : currentDoc);
|
|
133213
133213
|
}
|
|
133214
133214
|
function canBreakFn2(doc2) {
|
|
@@ -133294,7 +133294,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
133294
133294
|
negate: options8.negate
|
|
133295
133295
|
};
|
|
133296
133296
|
}
|
|
133297
|
-
function
|
|
133297
|
+
function join17(separator, docs) {
|
|
133298
133298
|
assertDoc2(separator);
|
|
133299
133299
|
assertDocArray2(docs);
|
|
133300
133300
|
const parts = [];
|
|
@@ -133959,7 +133959,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
133959
133959
|
}
|
|
133960
133960
|
}
|
|
133961
133961
|
var builders2 = {
|
|
133962
|
-
join:
|
|
133962
|
+
join: join17,
|
|
133963
133963
|
line: line3,
|
|
133964
133964
|
softline: softline2,
|
|
133965
133965
|
hardline: hardline4,
|
|
@@ -160399,10 +160399,10 @@ var require_view = __commonJS((exports, module) => {
|
|
|
160399
160399
|
var debug = require_src4()("express:view");
|
|
160400
160400
|
var path18 = __require("node:path");
|
|
160401
160401
|
var fs28 = __require("node:fs");
|
|
160402
|
-
var
|
|
160402
|
+
var dirname12 = path18.dirname;
|
|
160403
160403
|
var basename4 = path18.basename;
|
|
160404
160404
|
var extname2 = path18.extname;
|
|
160405
|
-
var
|
|
160405
|
+
var join18 = path18.join;
|
|
160406
160406
|
var resolve6 = path18.resolve;
|
|
160407
160407
|
module.exports = View;
|
|
160408
160408
|
function View(name2, options8) {
|
|
@@ -160438,7 +160438,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
160438
160438
|
for (var i5 = 0;i5 < roots.length && !path19; i5++) {
|
|
160439
160439
|
var root2 = roots[i5];
|
|
160440
160440
|
var loc = resolve6(root2, name2);
|
|
160441
|
-
var dir =
|
|
160441
|
+
var dir = dirname12(loc);
|
|
160442
160442
|
var file2 = basename4(loc);
|
|
160443
160443
|
path19 = this.resolve(dir, file2);
|
|
160444
160444
|
}
|
|
@@ -160464,12 +160464,12 @@ var require_view = __commonJS((exports, module) => {
|
|
|
160464
160464
|
};
|
|
160465
160465
|
View.prototype.resolve = function resolve7(dir, file2) {
|
|
160466
160466
|
var ext = this.ext;
|
|
160467
|
-
var path19 =
|
|
160467
|
+
var path19 = join18(dir, file2);
|
|
160468
160468
|
var stat2 = tryStat(path19);
|
|
160469
160469
|
if (stat2 && stat2.isFile()) {
|
|
160470
160470
|
return path19;
|
|
160471
160471
|
}
|
|
160472
|
-
path19 =
|
|
160472
|
+
path19 = join18(dir, basename4(file2, ext), "index" + ext);
|
|
160473
160473
|
stat2 = tryStat(path19);
|
|
160474
160474
|
if (stat2 && stat2.isFile()) {
|
|
160475
160475
|
return path19;
|
|
@@ -164164,7 +164164,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
164164
164164
|
var Stream2 = __require("stream");
|
|
164165
164165
|
var util2 = __require("util");
|
|
164166
164166
|
var extname2 = path18.extname;
|
|
164167
|
-
var
|
|
164167
|
+
var join18 = path18.join;
|
|
164168
164168
|
var normalize = path18.normalize;
|
|
164169
164169
|
var resolve6 = path18.resolve;
|
|
164170
164170
|
var sep = path18.sep;
|
|
@@ -164336,7 +164336,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
164336
164336
|
return res;
|
|
164337
164337
|
}
|
|
164338
164338
|
parts = path19.split(sep);
|
|
164339
|
-
path19 = normalize(
|
|
164339
|
+
path19 = normalize(join18(root2, path19));
|
|
164340
164340
|
} else {
|
|
164341
164341
|
if (UP_PATH_REGEXP.test(path19)) {
|
|
164342
164342
|
debug('malicious path "%s"', path19);
|
|
@@ -164476,7 +164476,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
164476
164476
|
return self2.onStatError(err);
|
|
164477
164477
|
return self2.error(404);
|
|
164478
164478
|
}
|
|
164479
|
-
var p4 =
|
|
164479
|
+
var p4 = join18(path19, self2._index[i5]);
|
|
164480
164480
|
debug('stat "%s"', p4);
|
|
164481
164481
|
fs28.stat(p4, function(err2, stat2) {
|
|
164482
164482
|
if (err2)
|
|
@@ -211071,7 +211071,7 @@ var require_buffer_list = __commonJS((exports, module) => {
|
|
|
211071
211071
|
}
|
|
211072
211072
|
}, {
|
|
211073
211073
|
key: "join",
|
|
211074
|
-
value: function
|
|
211074
|
+
value: function join18(s5) {
|
|
211075
211075
|
if (this.length === 0)
|
|
211076
211076
|
return "";
|
|
211077
211077
|
var p4 = this.head;
|
|
@@ -214782,7 +214782,7 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
214782
214782
|
});
|
|
214783
214783
|
|
|
214784
214784
|
// src/cli/index.ts
|
|
214785
|
-
import { dirname as
|
|
214785
|
+
import { dirname as dirname16, join as join21 } from "node:path";
|
|
214786
214786
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
214787
214787
|
|
|
214788
214788
|
// ../../node_modules/commander/esm.mjs
|
|
@@ -214802,7 +214802,7 @@ var {
|
|
|
214802
214802
|
} = import__.default;
|
|
214803
214803
|
|
|
214804
214804
|
// src/cli/commands/agents/pull.ts
|
|
214805
|
-
import { dirname as dirname7, join as
|
|
214805
|
+
import { dirname as dirname7, join as join11 } from "node:path";
|
|
214806
214806
|
|
|
214807
214807
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
214808
214808
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
@@ -237298,7 +237298,7 @@ var generateGlobTasks = normalizeArguments(generateTasks);
|
|
|
237298
237298
|
var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
|
|
237299
237299
|
|
|
237300
237300
|
// src/core/project/config.ts
|
|
237301
|
-
import { dirname as dirname5, join as
|
|
237301
|
+
import { dirname as dirname5, join as join7 } from "node:path";
|
|
237302
237302
|
|
|
237303
237303
|
// src/core/resources/agent/schema.ts
|
|
237304
237304
|
var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
|
|
@@ -238434,6 +238434,66 @@ async function pushFunctions(functions) {
|
|
|
238434
238434
|
const functionsWithCode = await Promise.all(functions.map(loadFunctionCode));
|
|
238435
238435
|
return deployFunctions(functionsWithCode);
|
|
238436
238436
|
}
|
|
238437
|
+
// src/core/resources/function/pull.ts
|
|
238438
|
+
import { join as join6 } from "node:path";
|
|
238439
|
+
import { isDeepStrictEqual as isDeepStrictEqual3 } from "node:util";
|
|
238440
|
+
async function writeFunctions(functionsDir, functions) {
|
|
238441
|
+
const written = [];
|
|
238442
|
+
const skipped = [];
|
|
238443
|
+
for (const fn of functions) {
|
|
238444
|
+
const functionDir = join6(functionsDir, fn.name);
|
|
238445
|
+
const configPath = join6(functionDir, "function.jsonc");
|
|
238446
|
+
if (await isFunctionUnchanged(functionDir, fn)) {
|
|
238447
|
+
skipped.push(fn.name);
|
|
238448
|
+
continue;
|
|
238449
|
+
}
|
|
238450
|
+
const config5 = {
|
|
238451
|
+
name: fn.name,
|
|
238452
|
+
entry: fn.entry
|
|
238453
|
+
};
|
|
238454
|
+
if (fn.automations.length > 0) {
|
|
238455
|
+
config5.automations = fn.automations;
|
|
238456
|
+
}
|
|
238457
|
+
await writeJsonFile(configPath, config5);
|
|
238458
|
+
for (const file2 of fn.files) {
|
|
238459
|
+
await writeFile(join6(functionDir, file2.path), file2.content);
|
|
238460
|
+
}
|
|
238461
|
+
written.push(fn.name);
|
|
238462
|
+
}
|
|
238463
|
+
return { written, skipped };
|
|
238464
|
+
}
|
|
238465
|
+
async function isFunctionUnchanged(functionDir, fn) {
|
|
238466
|
+
if (!await pathExists(functionDir)) {
|
|
238467
|
+
return false;
|
|
238468
|
+
}
|
|
238469
|
+
const configPath = join6(functionDir, "function.jsonc");
|
|
238470
|
+
try {
|
|
238471
|
+
const localConfig = await readJsonFile(configPath);
|
|
238472
|
+
if (localConfig.entry !== fn.entry) {
|
|
238473
|
+
return false;
|
|
238474
|
+
}
|
|
238475
|
+
if (!isDeepStrictEqual3(localConfig.automations ?? [], fn.automations)) {
|
|
238476
|
+
return false;
|
|
238477
|
+
}
|
|
238478
|
+
} catch {
|
|
238479
|
+
return false;
|
|
238480
|
+
}
|
|
238481
|
+
for (const file2 of fn.files) {
|
|
238482
|
+
const filePath = join6(functionDir, file2.path);
|
|
238483
|
+
if (!await pathExists(filePath)) {
|
|
238484
|
+
return false;
|
|
238485
|
+
}
|
|
238486
|
+
try {
|
|
238487
|
+
const localContent = await readTextFile(filePath);
|
|
238488
|
+
if (localContent !== file2.content) {
|
|
238489
|
+
return false;
|
|
238490
|
+
}
|
|
238491
|
+
} catch {
|
|
238492
|
+
return false;
|
|
238493
|
+
}
|
|
238494
|
+
}
|
|
238495
|
+
return true;
|
|
238496
|
+
}
|
|
238437
238497
|
// src/core/resources/function/resource.ts
|
|
238438
238498
|
var functionResource = {
|
|
238439
238499
|
readAll: readAllFunctions,
|
|
@@ -238478,10 +238538,10 @@ async function readProjectConfig(projectRoot) {
|
|
|
238478
238538
|
const project = result.data;
|
|
238479
238539
|
const configDir = dirname5(configPath);
|
|
238480
238540
|
const [entities, functions, agents, connectors] = await Promise.all([
|
|
238481
|
-
entityResource.readAll(
|
|
238482
|
-
functionResource.readAll(
|
|
238483
|
-
agentResource.readAll(
|
|
238484
|
-
connectorResource.readAll(
|
|
238541
|
+
entityResource.readAll(join7(configDir, project.entitiesDir)),
|
|
238542
|
+
functionResource.readAll(join7(configDir, project.functionsDir)),
|
|
238543
|
+
agentResource.readAll(join7(configDir, project.agentsDir)),
|
|
238544
|
+
connectorResource.readAll(join7(configDir, project.connectorsDir))
|
|
238485
238545
|
]);
|
|
238486
238546
|
return {
|
|
238487
238547
|
project: { ...project, root, configPath },
|
|
@@ -238578,12 +238638,12 @@ async function readAppConfig(projectRoot) {
|
|
|
238578
238638
|
// src/core/project/template.ts
|
|
238579
238639
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
238580
238640
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
238581
|
-
import { dirname as dirname6, join as
|
|
238641
|
+
import { dirname as dirname6, join as join9 } from "node:path";
|
|
238582
238642
|
|
|
238583
238643
|
// src/core/assets.ts
|
|
238584
238644
|
import { cpSync, existsSync } from "node:fs";
|
|
238585
238645
|
import { homedir as homedir2 } from "node:os";
|
|
238586
|
-
import { join as
|
|
238646
|
+
import { join as join8 } from "node:path";
|
|
238587
238647
|
// package.json
|
|
238588
238648
|
var package_default = {
|
|
238589
238649
|
name: "base44",
|
|
@@ -238676,15 +238736,15 @@ var package_default = {
|
|
|
238676
238736
|
};
|
|
238677
238737
|
|
|
238678
238738
|
// src/core/assets.ts
|
|
238679
|
-
var ASSETS_DIR =
|
|
238739
|
+
var ASSETS_DIR = join8(homedir2(), ".base44", "assets", package_default.version);
|
|
238680
238740
|
function getTemplatesDir() {
|
|
238681
|
-
return
|
|
238741
|
+
return join8(ASSETS_DIR, "templates");
|
|
238682
238742
|
}
|
|
238683
238743
|
function getTemplatesIndexPath() {
|
|
238684
|
-
return
|
|
238744
|
+
return join8(ASSETS_DIR, "templates", "templates.json");
|
|
238685
238745
|
}
|
|
238686
238746
|
function getDenoWrapperPath() {
|
|
238687
|
-
return
|
|
238747
|
+
return join8(ASSETS_DIR, "deno-runtime", "main.js");
|
|
238688
238748
|
}
|
|
238689
238749
|
function ensureNpmAssets(sourceDir) {
|
|
238690
238750
|
if (existsSync(ASSETS_DIR))
|
|
@@ -238705,23 +238765,23 @@ async function listTemplates() {
|
|
|
238705
238765
|
return result.data.templates;
|
|
238706
238766
|
}
|
|
238707
238767
|
async function renderTemplate(template, destPath, data) {
|
|
238708
|
-
const templateDir =
|
|
238768
|
+
const templateDir = join9(getTemplatesDir(), template.path);
|
|
238709
238769
|
const files = await globby("**/*", {
|
|
238710
238770
|
cwd: templateDir,
|
|
238711
238771
|
dot: true,
|
|
238712
238772
|
onlyFiles: true
|
|
238713
238773
|
});
|
|
238714
238774
|
for (const file2 of files) {
|
|
238715
|
-
const srcPath =
|
|
238775
|
+
const srcPath = join9(templateDir, file2);
|
|
238716
238776
|
try {
|
|
238717
238777
|
if (file2.endsWith(".ejs")) {
|
|
238718
238778
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
238719
238779
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
238720
|
-
const destFile = attributes.outputFileName ?
|
|
238721
|
-
const destFilePath =
|
|
238780
|
+
const destFile = attributes.outputFileName ? join9(dirname6(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
238781
|
+
const destFilePath = join9(destPath, destFile);
|
|
238722
238782
|
await writeFile(destFilePath, body);
|
|
238723
238783
|
} else {
|
|
238724
|
-
const destFilePath =
|
|
238784
|
+
const destFilePath = join9(destPath, file2);
|
|
238725
238785
|
await copyFile(srcPath, destFilePath);
|
|
238726
238786
|
}
|
|
238727
238787
|
} catch (error48) {
|
|
@@ -238820,7 +238880,7 @@ async function getSiteFilePaths(outputDir) {
|
|
|
238820
238880
|
// src/core/site/deploy.ts
|
|
238821
238881
|
import { randomUUID } from "node:crypto";
|
|
238822
238882
|
import { tmpdir } from "node:os";
|
|
238823
|
-
import { join as
|
|
238883
|
+
import { join as join10 } from "node:path";
|
|
238824
238884
|
async function deploySite(siteOutputDir) {
|
|
238825
238885
|
if (!await pathExists(siteOutputDir)) {
|
|
238826
238886
|
throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
|
|
@@ -238837,7 +238897,7 @@ async function deploySite(siteOutputDir) {
|
|
|
238837
238897
|
]
|
|
238838
238898
|
});
|
|
238839
238899
|
}
|
|
238840
|
-
const archivePath =
|
|
238900
|
+
const archivePath = join10(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
|
|
238841
238901
|
try {
|
|
238842
238902
|
await createArchive(siteOutputDir, archivePath);
|
|
238843
238903
|
return await uploadSite(archivePath);
|
|
@@ -246593,7 +246653,7 @@ function formatYaml(data, options = {}) {
|
|
|
246593
246653
|
async function pullAgentsAction() {
|
|
246594
246654
|
const { project: project2 } = await readProjectConfig();
|
|
246595
246655
|
const configDir = dirname7(project2.configPath);
|
|
246596
|
-
const agentsDir =
|
|
246656
|
+
const agentsDir = join11(configDir, project2.agentsDir);
|
|
246597
246657
|
const remoteAgents = await runTask("Fetching agents from Base44", async () => {
|
|
246598
246658
|
return await fetchAgents();
|
|
246599
246659
|
}, {
|
|
@@ -246715,11 +246775,11 @@ function getConnectorsListAvailableCommand(context) {
|
|
|
246715
246775
|
}
|
|
246716
246776
|
|
|
246717
246777
|
// src/cli/commands/connectors/pull.ts
|
|
246718
|
-
import { dirname as dirname8, join as
|
|
246778
|
+
import { dirname as dirname8, join as join12 } from "node:path";
|
|
246719
246779
|
async function pullConnectorsAction() {
|
|
246720
246780
|
const { project: project2 } = await readProjectConfig();
|
|
246721
246781
|
const configDir = dirname8(project2.configPath);
|
|
246722
|
-
const connectorsDir =
|
|
246782
|
+
const connectorsDir = join12(configDir, project2.connectorsDir);
|
|
246723
246783
|
const remoteConnectors = await runTask("Fetching connectors from Base44", async () => {
|
|
246724
246784
|
return await pullAllConnectors();
|
|
246725
246785
|
}, {
|
|
@@ -247647,13 +247707,57 @@ function getListCommand(context) {
|
|
|
247647
247707
|
});
|
|
247648
247708
|
}
|
|
247649
247709
|
|
|
247710
|
+
// src/cli/commands/functions/pull.ts
|
|
247711
|
+
import { dirname as dirname9, join as join13 } from "node:path";
|
|
247712
|
+
async function pullFunctionsAction(name2) {
|
|
247713
|
+
const { project: project2 } = await readProjectConfig();
|
|
247714
|
+
const configDir = dirname9(project2.configPath);
|
|
247715
|
+
const functionsDir = join13(configDir, project2.functionsDir);
|
|
247716
|
+
const remoteFunctions = await runTask("Fetching functions from Base44", async () => {
|
|
247717
|
+
const { functions } = await listDeployedFunctions();
|
|
247718
|
+
return functions;
|
|
247719
|
+
}, {
|
|
247720
|
+
successMessage: "Functions fetched successfully",
|
|
247721
|
+
errorMessage: "Failed to fetch functions"
|
|
247722
|
+
});
|
|
247723
|
+
const toPull = name2 ? remoteFunctions.filter((f) => f.name === name2) : remoteFunctions;
|
|
247724
|
+
if (name2 && toPull.length === 0) {
|
|
247725
|
+
return {
|
|
247726
|
+
outroMessage: `Function "${name2}" not found on remote`
|
|
247727
|
+
};
|
|
247728
|
+
}
|
|
247729
|
+
if (toPull.length === 0) {
|
|
247730
|
+
return { outroMessage: "No functions found on remote" };
|
|
247731
|
+
}
|
|
247732
|
+
const { written, skipped } = await runTask("Writing function files", async () => {
|
|
247733
|
+
return await writeFunctions(functionsDir, toPull);
|
|
247734
|
+
}, {
|
|
247735
|
+
successMessage: "Function files written successfully",
|
|
247736
|
+
errorMessage: "Failed to write function files"
|
|
247737
|
+
});
|
|
247738
|
+
for (const name3 of written) {
|
|
247739
|
+
R2.success(`${name3.padEnd(25)} written`);
|
|
247740
|
+
}
|
|
247741
|
+
for (const name3 of skipped) {
|
|
247742
|
+
R2.info(`${name3.padEnd(25)} unchanged`);
|
|
247743
|
+
}
|
|
247744
|
+
return {
|
|
247745
|
+
outroMessage: `Pulled ${toPull.length} function${toPull.length !== 1 ? "s" : ""} to ${functionsDir}`
|
|
247746
|
+
};
|
|
247747
|
+
}
|
|
247748
|
+
function getPullCommand(context) {
|
|
247749
|
+
return new Command("pull").description("Pull deployed functions from Base44").argument("[name]", "Pull a single function by name").action(async (name2) => {
|
|
247750
|
+
await runCommand(() => pullFunctionsAction(name2), { requireAuth: true }, context);
|
|
247751
|
+
});
|
|
247752
|
+
}
|
|
247753
|
+
|
|
247650
247754
|
// src/cli/commands/functions/index.ts
|
|
247651
247755
|
function getFunctionsCommand(context) {
|
|
247652
|
-
return new Command("functions").description("Manage backend functions").addCommand(getDeployCommand(context)).addCommand(getListCommand(context));
|
|
247756
|
+
return new Command("functions").description("Manage backend functions").addCommand(getDeployCommand(context)).addCommand(getListCommand(context)).addCommand(getPullCommand(context));
|
|
247653
247757
|
}
|
|
247654
247758
|
|
|
247655
247759
|
// src/cli/commands/project/create.ts
|
|
247656
|
-
import { basename as basename3, join as
|
|
247760
|
+
import { basename as basename3, join as join14, resolve as resolve2 } from "node:path";
|
|
247657
247761
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
247658
247762
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
247659
247763
|
async function getTemplateById(templateId) {
|
|
@@ -247789,7 +247893,7 @@ async function executeCreate({
|
|
|
247789
247893
|
updateMessage("Building project...");
|
|
247790
247894
|
await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
|
|
247791
247895
|
updateMessage("Deploying site...");
|
|
247792
|
-
return await deploySite(
|
|
247896
|
+
return await deploySite(join14(resolvedPath, outputDirectory));
|
|
247793
247897
|
}, {
|
|
247794
247898
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
247795
247899
|
errorMessage: "Failed to deploy site"
|
|
@@ -248432,10 +248536,10 @@ function toPascalCase(name2) {
|
|
|
248432
248536
|
return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
|
|
248433
248537
|
}
|
|
248434
248538
|
// src/core/types/update-project.ts
|
|
248435
|
-
import { join as
|
|
248539
|
+
import { join as join17 } from "node:path";
|
|
248436
248540
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
248437
248541
|
async function updateProjectConfig(projectRoot) {
|
|
248438
|
-
const tsconfigPath =
|
|
248542
|
+
const tsconfigPath = join17(projectRoot, "tsconfig.json");
|
|
248439
248543
|
if (!await pathExists(tsconfigPath)) {
|
|
248440
248544
|
return false;
|
|
248441
248545
|
}
|
|
@@ -248478,7 +248582,7 @@ function getTypesCommand(context) {
|
|
|
248478
248582
|
}
|
|
248479
248583
|
|
|
248480
248584
|
// src/cli/dev/dev-server/main.ts
|
|
248481
|
-
import { dirname as
|
|
248585
|
+
import { dirname as dirname14, join as join20 } from "node:path";
|
|
248482
248586
|
var import_cors = __toESM(require_lib4(), 1);
|
|
248483
248587
|
var import_express4 = __toESM(require_express(), 1);
|
|
248484
248588
|
|
|
@@ -249958,9 +250062,9 @@ class NodeFsHandler {
|
|
|
249958
250062
|
if (this.fsw.closed) {
|
|
249959
250063
|
return;
|
|
249960
250064
|
}
|
|
249961
|
-
const
|
|
250065
|
+
const dirname13 = sp2.dirname(file2);
|
|
249962
250066
|
const basename5 = sp2.basename(file2);
|
|
249963
|
-
const parent = this.fsw._getWatchedDir(
|
|
250067
|
+
const parent = this.fsw._getWatchedDir(dirname13);
|
|
249964
250068
|
let prevStats = stats;
|
|
249965
250069
|
if (parent.has(basename5))
|
|
249966
250070
|
return;
|
|
@@ -249987,7 +250091,7 @@ class NodeFsHandler {
|
|
|
249987
250091
|
prevStats = newStats2;
|
|
249988
250092
|
}
|
|
249989
250093
|
} catch (error48) {
|
|
249990
|
-
this.fsw._remove(
|
|
250094
|
+
this.fsw._remove(dirname13, basename5);
|
|
249991
250095
|
}
|
|
249992
250096
|
} else if (parent.has(basename5)) {
|
|
249993
250097
|
const at13 = newStats.atimeMs;
|
|
@@ -251008,8 +251112,8 @@ async function createDevServer(options8) {
|
|
|
251008
251112
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
251009
251113
|
};
|
|
251010
251114
|
const base44ConfigWatcher = new WatchBase44({
|
|
251011
|
-
functions:
|
|
251012
|
-
entities:
|
|
251115
|
+
functions: join20(dirname14(project2.configPath), project2.functionsDir),
|
|
251116
|
+
entities: join20(dirname14(project2.configPath), project2.entitiesDir)
|
|
251013
251117
|
}, devLogger);
|
|
251014
251118
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
251015
251119
|
try {
|
|
@@ -251199,7 +251303,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
251199
251303
|
import { release, type } from "node:os";
|
|
251200
251304
|
|
|
251201
251305
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
251202
|
-
import { dirname as
|
|
251306
|
+
import { dirname as dirname15, posix, sep } from "path";
|
|
251203
251307
|
function createModulerModifier() {
|
|
251204
251308
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
251205
251309
|
return async (frames) => {
|
|
@@ -251208,7 +251312,7 @@ function createModulerModifier() {
|
|
|
251208
251312
|
return frames;
|
|
251209
251313
|
};
|
|
251210
251314
|
}
|
|
251211
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
251315
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname15(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
251212
251316
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
251213
251317
|
return (filename) => {
|
|
251214
251318
|
if (!filename)
|
|
@@ -255397,9 +255501,9 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
|
|
|
255397
255501
|
});
|
|
255398
255502
|
}
|
|
255399
255503
|
// src/cli/index.ts
|
|
255400
|
-
var __dirname4 =
|
|
255504
|
+
var __dirname4 = dirname16(fileURLToPath6(import.meta.url));
|
|
255401
255505
|
async function runCLI() {
|
|
255402
|
-
ensureNpmAssets(
|
|
255506
|
+
ensureNpmAssets(join21(__dirname4, "../assets"));
|
|
255403
255507
|
const errorReporter = new ErrorReporter;
|
|
255404
255508
|
errorReporter.registerProcessErrorHandlers();
|
|
255405
255509
|
const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
|
|
@@ -255431,4 +255535,4 @@ export {
|
|
|
255431
255535
|
CLIExitError
|
|
255432
255536
|
};
|
|
255433
255537
|
|
|
255434
|
-
//# debugId=
|
|
255538
|
+
//# debugId=177D5D3CB71DE0D564756E2164756E21
|