@base44-preview/cli 0.0.38-pr.381.74c3c3d → 0.0.40-pr.386.9d07976
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/bin/binary-entry.ts +40 -0
- package/dist/assets/deno-runtime/main.ts +72 -0
- package/dist/cli/index.js +224 -268
- package/dist/cli/index.js.map +15 -17
- package/package.json +7 -4
- package/dist/deno-runtime/main.js +0 -31
- package/dist/deno-runtime/main.js.map +0 -10
- /package/dist/{templates → assets/templates}/backend-and-client/.nvmrc +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/README.md +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/base44/agents/task_manager.jsonc +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/base44/app.jsonc.ejs +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/base44/config.jsonc.ejs +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/base44/entities/task.jsonc +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/components.json +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/gitignore.ejs +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/index.html +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/jsconfig.json +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/package.json +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/postcss.config.js +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/src/App.jsx +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/src/api/base44Client.js.ejs +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/src/components/Base44Logo.jsx +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/src/components/ui/button.jsx +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/src/components/ui/checkbox.jsx +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/src/components/ui/input.jsx +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/src/index.css +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/src/main.jsx +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/tailwind.config.js +0 -0
- /package/dist/{templates → assets/templates}/backend-and-client/vite.config.js +0 -0
- /package/dist/{templates → assets/templates}/backend-only/base44/app.jsonc.ejs +0 -0
- /package/dist/{templates → assets/templates}/backend-only/base44/config.jsonc.ejs +0 -0
- /package/dist/{templates → assets/templates}/backend-only/base44/gitignore.ejs +0 -0
- /package/dist/{templates → assets/templates}/templates.json +0 -0
package/dist/cli/index.js
CHANGED
|
@@ -8933,10 +8933,10 @@ var require_ejs = __commonJS((exports) => {
|
|
|
8933
8933
|
exports.localsName = _DEFAULT_LOCALS_NAME;
|
|
8934
8934
|
exports.promiseImpl = new Function("return this;")().Promise;
|
|
8935
8935
|
exports.resolveInclude = function(name2, filename, isDir) {
|
|
8936
|
-
var
|
|
8936
|
+
var dirname6 = path11.dirname;
|
|
8937
8937
|
var extname = path11.extname;
|
|
8938
8938
|
var resolve = path11.resolve;
|
|
8939
|
-
var includePath = resolve(isDir ? filename :
|
|
8939
|
+
var includePath = resolve(isDir ? filename : dirname6(filename), name2);
|
|
8940
8940
|
var ext = extname(name2);
|
|
8941
8941
|
if (!ext) {
|
|
8942
8942
|
includePath += ".ejs";
|
|
@@ -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) {
|
|
@@ -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,
|
|
@@ -113630,7 +113630,7 @@ async function clearCache3() {
|
|
|
113630
113630
|
clearCache();
|
|
113631
113631
|
clearCache2();
|
|
113632
113632
|
}
|
|
113633
|
-
var require2, __filename2,
|
|
113633
|
+
var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc, __getOwnPropNames2, __getProtoOf2, __hasOwnProp2, __require2, __commonJS2 = (cb2, mod) => function __require22() {
|
|
113634
113634
|
return mod || (0, cb2[__getOwnPropNames2(cb2)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
113635
113635
|
}, __export3 = (target, all) => {
|
|
113636
113636
|
for (var name2 in all)
|
|
@@ -114373,7 +114373,7 @@ var init_prettier = __esm(() => {
|
|
|
114373
114373
|
init_doc();
|
|
114374
114374
|
require2 = __prettierCreateRequire(import.meta.url);
|
|
114375
114375
|
__filename2 = __prettierFileUrlToPath(import.meta.url);
|
|
114376
|
-
|
|
114376
|
+
__dirname3 = __prettierDirname(__filename2);
|
|
114377
114377
|
__create2 = Object.create;
|
|
114378
114378
|
__defProp3 = Object.defineProperty;
|
|
114379
114379
|
__getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -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,
|
|
@@ -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 dirname11 = path18.dirname;
|
|
156276
156276
|
var basename4 = path18.basename;
|
|
156277
156277
|
var extname2 = path18.extname;
|
|
156278
|
-
var
|
|
156278
|
+
var join16 = 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 = dirname11(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 = join16(dir, file2);
|
|
156341
156341
|
var stat2 = tryStat(path19);
|
|
156342
156342
|
if (stat2 && stat2.isFile()) {
|
|
156343
156343
|
return path19;
|
|
156344
156344
|
}
|
|
156345
|
-
path19 =
|
|
156345
|
+
path19 = join16(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 join16 = 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(join16(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 = join16(path19, self2._index[i5]);
|
|
160353
160353
|
debug('stat "%s"', p4);
|
|
160354
160354
|
fs28.stat(p4, function(err2, stat2) {
|
|
160355
160355
|
if (err2)
|
|
@@ -210590,7 +210590,7 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
210590
210590
|
});
|
|
210591
210591
|
module.exports = __toCommonJS(src_exports);
|
|
210592
210592
|
var import_promises22 = __require("node:fs/promises");
|
|
210593
|
-
var
|
|
210593
|
+
var import_node_fs22 = __require("node:fs");
|
|
210594
210594
|
var DEVIN_LOCAL_PATH = "/opt/.devin";
|
|
210595
210595
|
var CURSOR2 = "cursor";
|
|
210596
210596
|
var CURSOR_CLI = "cursor-cli";
|
|
@@ -210647,13 +210647,17 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
210647
210647
|
return { isAgent: true, agent: { name: REPLIT } };
|
|
210648
210648
|
}
|
|
210649
210649
|
try {
|
|
210650
|
-
await (0, import_promises22.access)(DEVIN_LOCAL_PATH,
|
|
210650
|
+
await (0, import_promises22.access)(DEVIN_LOCAL_PATH, import_node_fs22.constants.F_OK);
|
|
210651
210651
|
return { isAgent: true, agent: { name: DEVIN } };
|
|
210652
210652
|
} catch (error48) {}
|
|
210653
210653
|
return { isAgent: false, agent: undefined };
|
|
210654
210654
|
}
|
|
210655
210655
|
});
|
|
210656
210656
|
|
|
210657
|
+
// src/cli/index.ts
|
|
210658
|
+
import { dirname as dirname15, join as join19 } from "node:path";
|
|
210659
|
+
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
210660
|
+
|
|
210657
210661
|
// node_modules/commander/esm.mjs
|
|
210658
210662
|
var import__ = __toESM(require_commander(), 1);
|
|
210659
210663
|
var {
|
|
@@ -210671,7 +210675,7 @@ var {
|
|
|
210671
210675
|
} = import__.default;
|
|
210672
210676
|
|
|
210673
210677
|
// src/cli/commands/agents/pull.ts
|
|
210674
|
-
import { dirname as
|
|
210678
|
+
import { dirname as dirname7, join as join10 } from "node:path";
|
|
210675
210679
|
|
|
210676
210680
|
// node_modules/@clack/core/dist/index.mjs
|
|
210677
210681
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
@@ -226137,8 +226141,7 @@ var distribution_default = ky;
|
|
|
226137
226141
|
|
|
226138
226142
|
// src/core/config.ts
|
|
226139
226143
|
import { homedir } from "node:os";
|
|
226140
|
-
import {
|
|
226141
|
-
import { fileURLToPath } from "node:url";
|
|
226144
|
+
import { join } from "node:path";
|
|
226142
226145
|
|
|
226143
226146
|
// src/core/consts.ts
|
|
226144
226147
|
var PROJECT_SUBDIR = "base44";
|
|
@@ -226210,19 +226213,12 @@ var TestOverridesSchema = exports_external.object({
|
|
|
226210
226213
|
});
|
|
226211
226214
|
|
|
226212
226215
|
// src/core/config.ts
|
|
226213
|
-
var __dirname2 = dirname(fileURLToPath(import.meta.url));
|
|
226214
226216
|
function getBase44GlobalDir() {
|
|
226215
226217
|
return join(homedir(), ".base44");
|
|
226216
226218
|
}
|
|
226217
226219
|
function getAuthFilePath() {
|
|
226218
226220
|
return join(getBase44GlobalDir(), "auth", "auth.json");
|
|
226219
226221
|
}
|
|
226220
|
-
function getTemplatesDir() {
|
|
226221
|
-
return join(__dirname2, "../templates");
|
|
226222
|
-
}
|
|
226223
|
-
function getTemplatesIndexPath() {
|
|
226224
|
-
return join(getTemplatesDir(), "templates.json");
|
|
226225
|
-
}
|
|
226226
226222
|
function getAppConfigPath(projectRoot) {
|
|
226227
226223
|
return join(projectRoot, PROJECT_SUBDIR, ".app.jsonc");
|
|
226228
226224
|
}
|
|
@@ -226553,7 +226549,7 @@ import {
|
|
|
226553
226549
|
readdir,
|
|
226554
226550
|
unlink
|
|
226555
226551
|
} from "node:fs/promises";
|
|
226556
|
-
import { dirname
|
|
226552
|
+
import { dirname } from "node:path";
|
|
226557
226553
|
async function pathExists(path) {
|
|
226558
226554
|
try {
|
|
226559
226555
|
await access(path);
|
|
@@ -226563,14 +226559,14 @@ async function pathExists(path) {
|
|
|
226563
226559
|
}
|
|
226564
226560
|
}
|
|
226565
226561
|
async function writeFile(filePath, content) {
|
|
226566
|
-
const dir =
|
|
226562
|
+
const dir = dirname(filePath);
|
|
226567
226563
|
if (!await pathExists(dir)) {
|
|
226568
226564
|
await mkdir(dir, { recursive: true });
|
|
226569
226565
|
}
|
|
226570
226566
|
await fsWriteFile(filePath, content, "utf-8");
|
|
226571
226567
|
}
|
|
226572
226568
|
async function copyFile(src, dest) {
|
|
226573
|
-
const dir =
|
|
226569
|
+
const dir = dirname(dest);
|
|
226574
226570
|
if (!await pathExists(dir)) {
|
|
226575
226571
|
await mkdir(dir, { recursive: true });
|
|
226576
226572
|
}
|
|
@@ -226611,7 +226607,7 @@ async function readJsonFile(filePath) {
|
|
|
226611
226607
|
}
|
|
226612
226608
|
}
|
|
226613
226609
|
async function writeJsonFile(filePath, data) {
|
|
226614
|
-
const dir =
|
|
226610
|
+
const dir = dirname(filePath);
|
|
226615
226611
|
if (!await pathExists(dir)) {
|
|
226616
226612
|
await mkdir(dir, { recursive: true });
|
|
226617
226613
|
}
|
|
@@ -227761,7 +227757,7 @@ import path3 from "node:path";
|
|
|
227761
227757
|
|
|
227762
227758
|
// node_modules/tar/dist/esm/list.js
|
|
227763
227759
|
import fs2 from "node:fs";
|
|
227764
|
-
import { dirname as
|
|
227760
|
+
import { dirname as dirname2, parse as parse6 } from "path";
|
|
227765
227761
|
|
|
227766
227762
|
// node_modules/tar/dist/esm/options.js
|
|
227767
227763
|
var argmap = new Map([
|
|
@@ -229337,7 +229333,7 @@ var filesFilter = (opt, files) => {
|
|
|
229337
229333
|
if (m !== undefined) {
|
|
229338
229334
|
ret = m;
|
|
229339
229335
|
} else {
|
|
229340
|
-
ret = mapHas(
|
|
229336
|
+
ret = mapHas(dirname2(file2), root);
|
|
229341
229337
|
}
|
|
229342
229338
|
}
|
|
229343
229339
|
map2.set(file2, ret);
|
|
@@ -232498,10 +232494,10 @@ var import_fast_glob2 = __toESM(require_out4(), 1);
|
|
|
232498
232494
|
// node_modules/unicorn-magic/node.js
|
|
232499
232495
|
import { promisify } from "node:util";
|
|
232500
232496
|
import { execFile as execFileCallback, execFileSync as execFileSyncOriginal } from "node:child_process";
|
|
232501
|
-
import { fileURLToPath
|
|
232497
|
+
import { fileURLToPath } from "node:url";
|
|
232502
232498
|
var execFileOriginal = promisify(execFileCallback);
|
|
232503
232499
|
function toPath(urlOrPath) {
|
|
232504
|
-
return urlOrPath instanceof URL ?
|
|
232500
|
+
return urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;
|
|
232505
232501
|
}
|
|
232506
232502
|
var TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
|
|
232507
232503
|
|
|
@@ -232916,9 +232912,9 @@ var shouldExpandGlobstarDirectory = (pattern) => {
|
|
|
232916
232912
|
if (!match) {
|
|
232917
232913
|
return false;
|
|
232918
232914
|
}
|
|
232919
|
-
const
|
|
232920
|
-
const hasWildcards = /[*?[\]{}]/.test(
|
|
232921
|
-
const hasExtension = nodePath.extname(
|
|
232915
|
+
const dirname3 = match[1];
|
|
232916
|
+
const hasWildcards = /[*?[\]{}]/.test(dirname3);
|
|
232917
|
+
const hasExtension = nodePath.extname(dirname3) && !dirname3.startsWith(".");
|
|
232922
232918
|
return !hasWildcards && !hasExtension;
|
|
232923
232919
|
};
|
|
232924
232920
|
var getDirectoryGlob = ({ directoryPath, files, extensions }) => {
|
|
@@ -233175,7 +233171,7 @@ var generateGlobTasks = normalizeArguments(generateTasks);
|
|
|
233175
233171
|
var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
|
|
233176
233172
|
|
|
233177
233173
|
// src/core/project/config.ts
|
|
233178
|
-
import { dirname as
|
|
233174
|
+
import { dirname as dirname5, join as join6 } from "node:path";
|
|
233179
233175
|
|
|
233180
233176
|
// src/core/resources/agent/schema.ts
|
|
233181
233177
|
var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
|
|
@@ -233948,14 +233944,6 @@ async function deployFunctions(functions) {
|
|
|
233948
233944
|
}
|
|
233949
233945
|
return result.data;
|
|
233950
233946
|
}
|
|
233951
|
-
async function deleteSingleFunction(name2) {
|
|
233952
|
-
const appClient = getAppClient();
|
|
233953
|
-
try {
|
|
233954
|
-
await appClient.delete(`backend-functions/${encodeURIComponent(name2)}`, { timeout: 60000 });
|
|
233955
|
-
} catch (error48) {
|
|
233956
|
-
throw await ApiError.fromHttpError(error48, `deleting function "${name2}"`);
|
|
233957
|
-
}
|
|
233958
|
-
}
|
|
233959
233947
|
function buildLogsQueryString(filters) {
|
|
233960
233948
|
const params = new URLSearchParams;
|
|
233961
233949
|
if (filters.since) {
|
|
@@ -233993,7 +233981,7 @@ async function fetchFunctionLogs(functionName, filters = {}) {
|
|
|
233993
233981
|
return result.data;
|
|
233994
233982
|
}
|
|
233995
233983
|
// src/core/resources/function/config.ts
|
|
233996
|
-
import { basename as basename2, dirname as
|
|
233984
|
+
import { basename as basename2, dirname as dirname3, join as join5, relative } from "node:path";
|
|
233997
233985
|
async function readFunctionConfig(configPath) {
|
|
233998
233986
|
const parsed = await readJsonFile(configPath);
|
|
233999
233987
|
const result = FunctionConfigSchema.safeParse(parsed);
|
|
@@ -234004,7 +233992,7 @@ async function readFunctionConfig(configPath) {
|
|
|
234004
233992
|
}
|
|
234005
233993
|
async function readFunction(configPath) {
|
|
234006
233994
|
const config5 = await readFunctionConfig(configPath);
|
|
234007
|
-
const functionDir =
|
|
233995
|
+
const functionDir = dirname3(configPath);
|
|
234008
233996
|
const entryPath = join5(functionDir, config5.entry);
|
|
234009
233997
|
if (!await pathExists(entryPath)) {
|
|
234010
233998
|
throw new InvalidInputError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`, {
|
|
@@ -234031,11 +234019,11 @@ async function readAllFunctions(functionsDir) {
|
|
|
234031
234019
|
absolute: true,
|
|
234032
234020
|
ignore: ENTRY_IGNORE_DOT_PATHS
|
|
234033
234021
|
});
|
|
234034
|
-
const configFilesDirs = new Set(configFiles.map((f) =>
|
|
234035
|
-
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(
|
|
234022
|
+
const configFilesDirs = new Set(configFiles.map((f) => dirname3(f)));
|
|
234023
|
+
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(dirname3(entryFile)));
|
|
234036
234024
|
const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
|
|
234037
234025
|
const functionsWithoutConfig = await Promise.all(entryFilesWithoutConfig.map(async (entryFile) => {
|
|
234038
|
-
const functionDir =
|
|
234026
|
+
const functionDir = dirname3(entryFile);
|
|
234039
234027
|
const filePaths = await globby("**/*.{js,ts,json}", {
|
|
234040
234028
|
cwd: functionDir,
|
|
234041
234029
|
absolute: true
|
|
@@ -234070,9 +234058,9 @@ async function readAllFunctions(functionsDir) {
|
|
|
234070
234058
|
return functions;
|
|
234071
234059
|
}
|
|
234072
234060
|
// src/core/resources/function/deploy.ts
|
|
234073
|
-
import { dirname as
|
|
234061
|
+
import { dirname as dirname4, relative as relative2 } from "node:path";
|
|
234074
234062
|
async function loadFunctionCode(fn) {
|
|
234075
|
-
const functionDir =
|
|
234063
|
+
const functionDir = dirname4(fn.entryPath);
|
|
234076
234064
|
const loadedFiles = await Promise.all(fn.filePaths.map(async (filePath) => {
|
|
234077
234065
|
const content = await readTextFile(filePath);
|
|
234078
234066
|
const path11 = relative2(functionDir, filePath).split(/[/\\]/).join("/");
|
|
@@ -234102,12 +234090,12 @@ async function findConfigInDir(dir) {
|
|
|
234102
234090
|
}
|
|
234103
234091
|
async function findProjectRoot(startPath) {
|
|
234104
234092
|
let current = startPath || process.cwd();
|
|
234105
|
-
while (current !==
|
|
234093
|
+
while (current !== dirname5(current)) {
|
|
234106
234094
|
const configPath = await findConfigInDir(current);
|
|
234107
234095
|
if (configPath) {
|
|
234108
234096
|
return { root: current, configPath };
|
|
234109
234097
|
}
|
|
234110
|
-
current =
|
|
234098
|
+
current = dirname5(current);
|
|
234111
234099
|
}
|
|
234112
234100
|
return null;
|
|
234113
234101
|
}
|
|
@@ -234129,7 +234117,7 @@ async function readProjectConfig(projectRoot) {
|
|
|
234129
234117
|
throw new SchemaValidationError("Invalid project configuration", result.error, configPath);
|
|
234130
234118
|
}
|
|
234131
234119
|
const project = result.data;
|
|
234132
|
-
const configDir =
|
|
234120
|
+
const configDir = dirname5(configPath);
|
|
234133
234121
|
const [entities, functions, agents, connectors] = await Promise.all([
|
|
234134
234122
|
entityResource.readAll(join6(configDir, project.entitiesDir)),
|
|
234135
234123
|
functionResource.readAll(join6(configDir, project.functionsDir)),
|
|
@@ -234231,33 +234219,152 @@ async function readAppConfig(projectRoot) {
|
|
|
234231
234219
|
// src/core/project/template.ts
|
|
234232
234220
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
234233
234221
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
234234
|
-
import { dirname as
|
|
234222
|
+
import { dirname as dirname6, join as join8 } from "node:path";
|
|
234223
|
+
|
|
234224
|
+
// src/core/assets.ts
|
|
234225
|
+
import { cpSync, existsSync } from "node:fs";
|
|
234226
|
+
import { homedir as homedir2 } from "node:os";
|
|
234227
|
+
import { join as join7 } from "node:path";
|
|
234228
|
+
// package.json
|
|
234229
|
+
var package_default = {
|
|
234230
|
+
name: "base44",
|
|
234231
|
+
version: "0.0.40",
|
|
234232
|
+
description: "Base44 CLI - Unified interface for managing Base44 applications",
|
|
234233
|
+
type: "module",
|
|
234234
|
+
bin: {
|
|
234235
|
+
base44: "./bin/run.js"
|
|
234236
|
+
},
|
|
234237
|
+
files: [
|
|
234238
|
+
"dist/cli",
|
|
234239
|
+
"dist/assets",
|
|
234240
|
+
"bin"
|
|
234241
|
+
],
|
|
234242
|
+
scripts: {
|
|
234243
|
+
build: "bun run clean && mkdir -p dist/assets && cp -r templates dist/assets/ && bun run infra/build.ts",
|
|
234244
|
+
"build:watch": "bun run clean && mkdir -p dist/assets && cp -r templates dist/assets/ && bun run infra/build.ts --watch",
|
|
234245
|
+
typecheck: "tsc --noEmit",
|
|
234246
|
+
dev: "./bin/dev.ts",
|
|
234247
|
+
start: "./bin/run.js",
|
|
234248
|
+
clean: "rm -rf dist && mkdir -p dist",
|
|
234249
|
+
lint: "biome check src tests",
|
|
234250
|
+
"lint:fix": "biome check --write src tests",
|
|
234251
|
+
test: "vitest run",
|
|
234252
|
+
"test:watch": "vitest",
|
|
234253
|
+
"build:binaries": "bun run infra/build-binaries.ts",
|
|
234254
|
+
"package:binaries": "bun run infra/package-binaries.ts",
|
|
234255
|
+
knip: "knip",
|
|
234256
|
+
"knip:fix": "knip --fix"
|
|
234257
|
+
},
|
|
234258
|
+
keywords: [
|
|
234259
|
+
"base44",
|
|
234260
|
+
"cli",
|
|
234261
|
+
"command-line"
|
|
234262
|
+
],
|
|
234263
|
+
author: "",
|
|
234264
|
+
license: "MIT",
|
|
234265
|
+
repository: {
|
|
234266
|
+
type: "git",
|
|
234267
|
+
url: "https://github.com/base44/cli"
|
|
234268
|
+
},
|
|
234269
|
+
devDependencies: {
|
|
234270
|
+
"@biomejs/biome": "^2.0.0",
|
|
234271
|
+
"@clack/prompts": "^1.0.1",
|
|
234272
|
+
"@seald-io/nedb": "^4.1.2",
|
|
234273
|
+
"@types/bun": "^1.2.15",
|
|
234274
|
+
"@types/common-tags": "^1.8.4",
|
|
234275
|
+
"@types/cors": "^2.8.19",
|
|
234276
|
+
"@types/deno": "^2.5.0",
|
|
234277
|
+
"@types/ejs": "^3.1.5",
|
|
234278
|
+
"@types/express": "^5.0.6",
|
|
234279
|
+
"@types/json-schema": "^7.0.15",
|
|
234280
|
+
"@types/lodash": "^4.17.24",
|
|
234281
|
+
"@types/multer": "^2.0.0",
|
|
234282
|
+
"@types/node": "^22.10.5",
|
|
234283
|
+
"@vercel/detect-agent": "^1.1.0",
|
|
234284
|
+
chalk: "^5.6.2",
|
|
234285
|
+
chokidar: "^5.0.0",
|
|
234286
|
+
commander: "^12.1.0",
|
|
234287
|
+
"common-tags": "^1.8.2",
|
|
234288
|
+
cors: "^2.8.5",
|
|
234289
|
+
dotenv: "17.3.1",
|
|
234290
|
+
ejs: "^3.1.10",
|
|
234291
|
+
execa: "^9.6.1",
|
|
234292
|
+
express: "^5.0.1",
|
|
234293
|
+
"front-matter": "^4.0.2",
|
|
234294
|
+
"get-port": "^7.1.0",
|
|
234295
|
+
globby: "^16.1.0",
|
|
234296
|
+
"http-proxy-middleware": "^3.0.5",
|
|
234297
|
+
"json-schema-to-typescript": "^15.0.4",
|
|
234298
|
+
json5: "^2.2.3",
|
|
234299
|
+
knip: "^5.83.1",
|
|
234300
|
+
ky: "^1.14.2",
|
|
234301
|
+
lodash: "^4.17.23",
|
|
234302
|
+
msw: "^2.12.10",
|
|
234303
|
+
multer: "^2.0.0",
|
|
234304
|
+
nanoid: "^5.1.6",
|
|
234305
|
+
open: "^11.0.0",
|
|
234306
|
+
"p-wait-for": "^6.0.0",
|
|
234307
|
+
"posthog-node": "5.21.2",
|
|
234308
|
+
"socket.io": "^4.8.3",
|
|
234309
|
+
"strip-ansi": "^7.1.2",
|
|
234310
|
+
tar: "^7.5.4",
|
|
234311
|
+
"tmp-promise": "^3.0.3",
|
|
234312
|
+
typescript: "^5.7.2",
|
|
234313
|
+
vitest: "^4.0.16",
|
|
234314
|
+
zod: "^4.3.5"
|
|
234315
|
+
},
|
|
234316
|
+
engines: {
|
|
234317
|
+
node: ">=20.19.0"
|
|
234318
|
+
}
|
|
234319
|
+
};
|
|
234320
|
+
|
|
234321
|
+
// src/core/assets.ts
|
|
234322
|
+
var ASSETS_DIR = join7(homedir2(), ".base44", "assets", package_default.version);
|
|
234323
|
+
function getTemplatesDir() {
|
|
234324
|
+
return join7(ASSETS_DIR, "templates");
|
|
234325
|
+
}
|
|
234326
|
+
function getTemplatesIndexPath() {
|
|
234327
|
+
return join7(ASSETS_DIR, "templates", "templates.json");
|
|
234328
|
+
}
|
|
234329
|
+
function getDenoWrapperPath() {
|
|
234330
|
+
return join7(ASSETS_DIR, "deno-runtime", "main.ts");
|
|
234331
|
+
}
|
|
234332
|
+
function ensureNpmAssets(sourceDir) {
|
|
234333
|
+
if (existsSync(ASSETS_DIR))
|
|
234334
|
+
return;
|
|
234335
|
+
if (!existsSync(sourceDir))
|
|
234336
|
+
return;
|
|
234337
|
+
cpSync(sourceDir, ASSETS_DIR, { recursive: true });
|
|
234338
|
+
}
|
|
234339
|
+
|
|
234340
|
+
// src/core/project/template.ts
|
|
234235
234341
|
async function listTemplates() {
|
|
234236
|
-
const
|
|
234342
|
+
const indexPath = getTemplatesIndexPath();
|
|
234343
|
+
const parsed = await readJsonFile(indexPath);
|
|
234237
234344
|
const result = TemplatesConfigSchema.safeParse(parsed);
|
|
234238
234345
|
if (!result.success) {
|
|
234239
|
-
throw new SchemaValidationError("Invalid templates configuration", result.error,
|
|
234346
|
+
throw new SchemaValidationError("Invalid templates configuration", result.error, indexPath);
|
|
234240
234347
|
}
|
|
234241
234348
|
return result.data.templates;
|
|
234242
234349
|
}
|
|
234243
234350
|
async function renderTemplate(template, destPath, data) {
|
|
234244
|
-
const templateDir =
|
|
234351
|
+
const templateDir = join8(getTemplatesDir(), template.path);
|
|
234245
234352
|
const files = await globby("**/*", {
|
|
234246
234353
|
cwd: templateDir,
|
|
234247
234354
|
dot: true,
|
|
234248
234355
|
onlyFiles: true
|
|
234249
234356
|
});
|
|
234250
234357
|
for (const file2 of files) {
|
|
234251
|
-
const srcPath =
|
|
234358
|
+
const srcPath = join8(templateDir, file2);
|
|
234252
234359
|
try {
|
|
234253
234360
|
if (file2.endsWith(".ejs")) {
|
|
234254
234361
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
234255
234362
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
234256
|
-
const destFile = attributes.outputFileName ?
|
|
234257
|
-
const destFilePath =
|
|
234363
|
+
const destFile = attributes.outputFileName ? join8(dirname6(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
234364
|
+
const destFilePath = join8(destPath, destFile);
|
|
234258
234365
|
await writeFile(destFilePath, body);
|
|
234259
234366
|
} else {
|
|
234260
|
-
const destFilePath =
|
|
234367
|
+
const destFilePath = join8(destPath, file2);
|
|
234261
234368
|
await copyFile(srcPath, destFilePath);
|
|
234262
234369
|
}
|
|
234263
234370
|
} catch (error48) {
|
|
@@ -234281,11 +234388,7 @@ async function createProjectFiles(options) {
|
|
|
234281
234388
|
const { name: name2, description, path: basePath, template } = options;
|
|
234282
234389
|
await assertProjectNotExists(basePath);
|
|
234283
234390
|
const { projectId } = await createProject(name2, description);
|
|
234284
|
-
await renderTemplate(template, basePath, {
|
|
234285
|
-
name: name2,
|
|
234286
|
-
description,
|
|
234287
|
-
projectId
|
|
234288
|
-
});
|
|
234391
|
+
await renderTemplate(template, basePath, { name: name2, description, projectId });
|
|
234289
234392
|
return {
|
|
234290
234393
|
projectId,
|
|
234291
234394
|
projectDir: basePath
|
|
@@ -234360,7 +234463,7 @@ async function getSiteFilePaths(outputDir) {
|
|
|
234360
234463
|
// src/core/site/deploy.ts
|
|
234361
234464
|
import { randomUUID } from "node:crypto";
|
|
234362
234465
|
import { tmpdir } from "node:os";
|
|
234363
|
-
import { join as
|
|
234466
|
+
import { join as join9 } from "node:path";
|
|
234364
234467
|
async function deploySite(siteOutputDir) {
|
|
234365
234468
|
if (!await pathExists(siteOutputDir)) {
|
|
234366
234469
|
throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
|
|
@@ -234377,7 +234480,7 @@ async function deploySite(siteOutputDir) {
|
|
|
234377
234480
|
]
|
|
234378
234481
|
});
|
|
234379
234482
|
}
|
|
234380
|
-
const archivePath =
|
|
234483
|
+
const archivePath = join9(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
|
|
234381
234484
|
try {
|
|
234382
234485
|
await createArchive(siteOutputDir, archivePath);
|
|
234383
234486
|
return await uploadSite(archivePath);
|
|
@@ -235457,7 +235560,7 @@ function isPlainObject2(value) {
|
|
|
235457
235560
|
}
|
|
235458
235561
|
|
|
235459
235562
|
// node_modules/execa/lib/arguments/file-url.js
|
|
235460
|
-
import { fileURLToPath as
|
|
235563
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
235461
235564
|
var safeNormalizeFileUrl = (file2, name2) => {
|
|
235462
235565
|
const fileString = normalizeFileUrl(normalizeDenoExecPath(file2));
|
|
235463
235566
|
if (typeof fileString !== "string") {
|
|
@@ -235467,7 +235570,7 @@ var safeNormalizeFileUrl = (file2, name2) => {
|
|
|
235467
235570
|
};
|
|
235468
235571
|
var normalizeDenoExecPath = (file2) => isDenoExecPath(file2) ? file2.toString() : file2;
|
|
235469
235572
|
var isDenoExecPath = (file2) => typeof file2 !== "string" && file2 && Object.getPrototypeOf(file2) === String.prototype;
|
|
235470
|
-
var normalizeFileUrl = (file2) => file2 instanceof URL ?
|
|
235573
|
+
var normalizeFileUrl = (file2) => file2 instanceof URL ? fileURLToPath2(file2) : file2;
|
|
235471
235574
|
|
|
235472
235575
|
// node_modules/execa/lib/methods/parameters.js
|
|
235473
235576
|
var normalizeParameters = (rawFile, rawArguments = [], rawOptions = {}) => {
|
|
@@ -236321,10 +236424,10 @@ function pathKey(options = {}) {
|
|
|
236321
236424
|
import { promisify as promisify3 } from "node:util";
|
|
236322
236425
|
import { execFile as execFileCallback2, execFileSync as execFileSyncOriginal2 } from "node:child_process";
|
|
236323
236426
|
import path11 from "node:path";
|
|
236324
|
-
import { fileURLToPath as
|
|
236427
|
+
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
236325
236428
|
var execFileOriginal2 = promisify3(execFileCallback2);
|
|
236326
236429
|
function toPath2(urlOrPath) {
|
|
236327
|
-
return urlOrPath instanceof URL ?
|
|
236430
|
+
return urlOrPath instanceof URL ? fileURLToPath3(urlOrPath) : urlOrPath;
|
|
236328
236431
|
}
|
|
236329
236432
|
function traversePathUp(startPath) {
|
|
236330
236433
|
return {
|
|
@@ -241942,95 +242045,6 @@ var {
|
|
|
241942
242045
|
getEachMessage: getEachMessage2,
|
|
241943
242046
|
getCancelSignal: getCancelSignal2
|
|
241944
242047
|
} = getIpcExport();
|
|
241945
|
-
// package.json
|
|
241946
|
-
var package_default = {
|
|
241947
|
-
name: "base44",
|
|
241948
|
-
version: "0.0.38",
|
|
241949
|
-
description: "Base44 CLI - Unified interface for managing Base44 applications",
|
|
241950
|
-
type: "module",
|
|
241951
|
-
bin: {
|
|
241952
|
-
base44: "./bin/run.js"
|
|
241953
|
-
},
|
|
241954
|
-
files: [
|
|
241955
|
-
"dist",
|
|
241956
|
-
"bin"
|
|
241957
|
-
],
|
|
241958
|
-
scripts: {
|
|
241959
|
-
build: "bun run clean && cp -r templates dist/ && bun run infra/build.ts",
|
|
241960
|
-
"build:watch": "bun run clean && cp -r templates dist/ && bun run infra/build.ts --watch",
|
|
241961
|
-
typecheck: "tsc --noEmit",
|
|
241962
|
-
dev: "./bin/dev.ts",
|
|
241963
|
-
start: "./bin/run.js",
|
|
241964
|
-
clean: "rm -rf dist && mkdir -p dist",
|
|
241965
|
-
lint: "biome check src tests",
|
|
241966
|
-
"lint:fix": "biome check --write src tests",
|
|
241967
|
-
test: "vitest run",
|
|
241968
|
-
"test:watch": "vitest",
|
|
241969
|
-
knip: "knip",
|
|
241970
|
-
"knip:fix": "knip --fix"
|
|
241971
|
-
},
|
|
241972
|
-
keywords: [
|
|
241973
|
-
"base44",
|
|
241974
|
-
"cli",
|
|
241975
|
-
"command-line"
|
|
241976
|
-
],
|
|
241977
|
-
author: "",
|
|
241978
|
-
license: "MIT",
|
|
241979
|
-
repository: {
|
|
241980
|
-
type: "git",
|
|
241981
|
-
url: "https://github.com/base44/cli"
|
|
241982
|
-
},
|
|
241983
|
-
devDependencies: {
|
|
241984
|
-
"@biomejs/biome": "^2.0.0",
|
|
241985
|
-
"@clack/prompts": "^1.0.1",
|
|
241986
|
-
"@seald-io/nedb": "^4.1.2",
|
|
241987
|
-
"@types/bun": "^1.2.15",
|
|
241988
|
-
"@types/common-tags": "^1.8.4",
|
|
241989
|
-
"@types/cors": "^2.8.19",
|
|
241990
|
-
"@types/deno": "^2.5.0",
|
|
241991
|
-
"@types/ejs": "^3.1.5",
|
|
241992
|
-
"@types/express": "^5.0.6",
|
|
241993
|
-
"@types/json-schema": "^7.0.15",
|
|
241994
|
-
"@types/lodash": "^4.17.24",
|
|
241995
|
-
"@types/multer": "^2.0.0",
|
|
241996
|
-
"@types/node": "^22.10.5",
|
|
241997
|
-
"@vercel/detect-agent": "^1.1.0",
|
|
241998
|
-
chalk: "^5.6.2",
|
|
241999
|
-
chokidar: "^5.0.0",
|
|
242000
|
-
commander: "^12.1.0",
|
|
242001
|
-
"common-tags": "^1.8.2",
|
|
242002
|
-
cors: "^2.8.5",
|
|
242003
|
-
dotenv: "17.3.1",
|
|
242004
|
-
ejs: "^3.1.10",
|
|
242005
|
-
execa: "^9.6.1",
|
|
242006
|
-
express: "^5.0.1",
|
|
242007
|
-
"front-matter": "^4.0.2",
|
|
242008
|
-
"get-port": "^7.1.0",
|
|
242009
|
-
globby: "^16.1.0",
|
|
242010
|
-
"http-proxy-middleware": "^3.0.5",
|
|
242011
|
-
"json-schema-to-typescript": "^15.0.4",
|
|
242012
|
-
json5: "^2.2.3",
|
|
242013
|
-
knip: "^5.83.1",
|
|
242014
|
-
ky: "^1.14.2",
|
|
242015
|
-
lodash: "^4.17.23",
|
|
242016
|
-
msw: "^2.12.10",
|
|
242017
|
-
multer: "^2.0.0",
|
|
242018
|
-
nanoid: "^5.1.6",
|
|
242019
|
-
open: "^11.0.0",
|
|
242020
|
-
"p-wait-for": "^6.0.0",
|
|
242021
|
-
"posthog-node": "5.21.2",
|
|
242022
|
-
"socket.io": "^4.8.3",
|
|
242023
|
-
"strip-ansi": "^7.1.2",
|
|
242024
|
-
tar: "^7.5.4",
|
|
242025
|
-
"tmp-promise": "^3.0.3",
|
|
242026
|
-
typescript: "^5.7.2",
|
|
242027
|
-
vitest: "^4.0.16",
|
|
242028
|
-
zod: "^4.3.5"
|
|
242029
|
-
},
|
|
242030
|
-
engines: {
|
|
242031
|
-
node: ">=20.19.0"
|
|
242032
|
-
}
|
|
242033
|
-
};
|
|
242034
242048
|
|
|
242035
242049
|
// src/cli/utils/version-check.ts
|
|
242036
242050
|
async function checkForUpgrade() {
|
|
@@ -242154,8 +242168,8 @@ function getDashboardUrl(projectId) {
|
|
|
242154
242168
|
// src/cli/commands/agents/pull.ts
|
|
242155
242169
|
async function pullAgentsAction() {
|
|
242156
242170
|
const { project: project2 } = await readProjectConfig();
|
|
242157
|
-
const configDir =
|
|
242158
|
-
const agentsDir =
|
|
242171
|
+
const configDir = dirname7(project2.configPath);
|
|
242172
|
+
const agentsDir = join10(configDir, project2.agentsDir);
|
|
242159
242173
|
const remoteAgents = await runTask("Fetching agents from Base44", async () => {
|
|
242160
242174
|
return await fetchAgents();
|
|
242161
242175
|
}, {
|
|
@@ -242249,11 +242263,11 @@ function getWhoamiCommand(context) {
|
|
|
242249
242263
|
}
|
|
242250
242264
|
|
|
242251
242265
|
// src/cli/commands/connectors/pull.ts
|
|
242252
|
-
import { dirname as
|
|
242266
|
+
import { dirname as dirname8, join as join11 } from "node:path";
|
|
242253
242267
|
async function pullConnectorsAction() {
|
|
242254
242268
|
const { project: project2 } = await readProjectConfig();
|
|
242255
|
-
const configDir =
|
|
242256
|
-
const connectorsDir =
|
|
242269
|
+
const configDir = dirname8(project2.configPath);
|
|
242270
|
+
const connectorsDir = join11(configDir, project2.connectorsDir);
|
|
242257
242271
|
const remoteConnectors = await runTask("Fetching connectors from Base44", async () => {
|
|
242258
242272
|
return await listConnectors();
|
|
242259
242273
|
}, {
|
|
@@ -242288,7 +242302,7 @@ function getConnectorsPullCommand(context) {
|
|
|
242288
242302
|
// node_modules/open/index.js
|
|
242289
242303
|
import process20 from "node:process";
|
|
242290
242304
|
import path16 from "node:path";
|
|
242291
|
-
import { fileURLToPath as
|
|
242305
|
+
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
242292
242306
|
import childProcess3 from "node:child_process";
|
|
242293
242307
|
import fs19, { constants as fsConstants2 } from "node:fs/promises";
|
|
242294
242308
|
|
|
@@ -242614,8 +242628,8 @@ var is_in_ssh_default = isInSsh;
|
|
|
242614
242628
|
|
|
242615
242629
|
// node_modules/open/index.js
|
|
242616
242630
|
var fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
242617
|
-
var
|
|
242618
|
-
var localXdgOpenPath = path16.join(
|
|
242631
|
+
var __dirname2 = import.meta.url ? path16.dirname(fileURLToPath4(import.meta.url)) : "";
|
|
242632
|
+
var localXdgOpenPath = path16.join(__dirname2, "xdg-open");
|
|
242619
242633
|
var { platform: platform6, arch } = process20;
|
|
242620
242634
|
var tryEachApp = async (apps, opener) => {
|
|
242621
242635
|
if (apps.length === 0) {
|
|
@@ -242759,7 +242773,7 @@ var baseOpen = async (options) => {
|
|
|
242759
242773
|
if (app) {
|
|
242760
242774
|
command = app;
|
|
242761
242775
|
} else {
|
|
242762
|
-
const isBundled = !
|
|
242776
|
+
const isBundled = !__dirname2 || __dirname2 === "/";
|
|
242763
242777
|
let exeLocalXdgOpen = false;
|
|
242764
242778
|
try {
|
|
242765
242779
|
await fs19.access(localXdgOpenPath, fsConstants2.X_OK);
|
|
@@ -243101,63 +243115,6 @@ function getEntitiesPushCommand(context) {
|
|
|
243101
243115
|
}));
|
|
243102
243116
|
}
|
|
243103
243117
|
|
|
243104
|
-
// src/cli/utils/parseNames.ts
|
|
243105
|
-
function parseNames(args) {
|
|
243106
|
-
return args.flatMap((arg) => arg.split(",")).map((n2) => n2.trim()).filter(Boolean);
|
|
243107
|
-
}
|
|
243108
|
-
|
|
243109
|
-
// src/cli/commands/functions/delete.ts
|
|
243110
|
-
async function deleteFunctionsAction(names) {
|
|
243111
|
-
let deleted = 0;
|
|
243112
|
-
let notFound = 0;
|
|
243113
|
-
let errors4 = 0;
|
|
243114
|
-
let completed = 0;
|
|
243115
|
-
const total = names.length;
|
|
243116
|
-
for (const name2 of names) {
|
|
243117
|
-
R2.step(theme.styles.dim(`[${completed + 1}/${total}] Deleting ${name2}...`));
|
|
243118
|
-
try {
|
|
243119
|
-
await deleteSingleFunction(name2);
|
|
243120
|
-
R2.success(`${name2.padEnd(25)} deleted`);
|
|
243121
|
-
deleted++;
|
|
243122
|
-
} catch (error48) {
|
|
243123
|
-
if (error48 instanceof ApiError && error48.statusCode === 404) {
|
|
243124
|
-
R2.warn(`${name2.padEnd(25)} not found`);
|
|
243125
|
-
notFound++;
|
|
243126
|
-
} else {
|
|
243127
|
-
R2.error(`${name2.padEnd(25)} error: ${error48 instanceof Error ? error48.message : String(error48)}`);
|
|
243128
|
-
errors4++;
|
|
243129
|
-
}
|
|
243130
|
-
}
|
|
243131
|
-
completed++;
|
|
243132
|
-
}
|
|
243133
|
-
if (names.length === 1) {
|
|
243134
|
-
if (deleted)
|
|
243135
|
-
return { outroMessage: `Function "${names[0]}" deleted` };
|
|
243136
|
-
if (notFound)
|
|
243137
|
-
return { outroMessage: `Function "${names[0]}" not found` };
|
|
243138
|
-
return { outroMessage: `Failed to delete "${names[0]}"` };
|
|
243139
|
-
}
|
|
243140
|
-
const parts = [];
|
|
243141
|
-
if (deleted > 0)
|
|
243142
|
-
parts.push(`${deleted}/${total} deleted`);
|
|
243143
|
-
if (notFound > 0)
|
|
243144
|
-
parts.push(`${notFound} not found`);
|
|
243145
|
-
if (errors4 > 0)
|
|
243146
|
-
parts.push(`${errors4} error${errors4 !== 1 ? "s" : ""}`);
|
|
243147
|
-
return { outroMessage: parts.join(", ") };
|
|
243148
|
-
}
|
|
243149
|
-
function getDeleteCommand(context) {
|
|
243150
|
-
return new Command("delete").description("Delete deployed functions").argument("<names...>", "Function names to delete").action(async (rawNames) => {
|
|
243151
|
-
await runCommand(() => {
|
|
243152
|
-
const names = parseNames(rawNames);
|
|
243153
|
-
if (names.length === 0) {
|
|
243154
|
-
throw new InvalidInputError("At least one function name is required");
|
|
243155
|
-
}
|
|
243156
|
-
return deleteFunctionsAction(names);
|
|
243157
|
-
}, { requireAuth: true }, context);
|
|
243158
|
-
});
|
|
243159
|
-
}
|
|
243160
|
-
|
|
243161
243118
|
// src/cli/commands/functions/deploy.ts
|
|
243162
243119
|
async function deployFunctionsAction() {
|
|
243163
243120
|
const { functions } = await readProjectConfig();
|
|
@@ -243190,19 +243147,14 @@ async function deployFunctionsAction() {
|
|
|
243190
243147
|
}
|
|
243191
243148
|
return { outroMessage: "Functions deployed to Base44" };
|
|
243192
243149
|
}
|
|
243193
|
-
function
|
|
243194
|
-
return new Command("deploy").description("Deploy local functions to Base44").action(async () => {
|
|
243150
|
+
function getFunctionsDeployCommand(context) {
|
|
243151
|
+
return new Command("functions").description("Manage project functions").addCommand(new Command("deploy").description("Deploy local functions to Base44").action(async () => {
|
|
243195
243152
|
await runCommand(deployFunctionsAction, { requireAuth: true }, context);
|
|
243196
|
-
});
|
|
243197
|
-
}
|
|
243198
|
-
|
|
243199
|
-
// src/cli/commands/functions/index.ts
|
|
243200
|
-
function getFunctionsCommand(context) {
|
|
243201
|
-
return new Command("functions").description("Manage backend functions").addCommand(getDeployCommand(context)).addCommand(getDeleteCommand(context));
|
|
243153
|
+
}));
|
|
243202
243154
|
}
|
|
243203
243155
|
|
|
243204
243156
|
// src/cli/commands/project/create.ts
|
|
243205
|
-
import { basename as basename3, join as
|
|
243157
|
+
import { basename as basename3, join as join12, resolve as resolve2 } from "node:path";
|
|
243206
243158
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
243207
243159
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
243208
243160
|
async function getTemplateById(templateId) {
|
|
@@ -243338,7 +243290,7 @@ async function executeCreate({
|
|
|
243338
243290
|
updateMessage("Building project...");
|
|
243339
243291
|
await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
|
|
243340
243292
|
updateMessage("Deploying site...");
|
|
243341
|
-
return await deploySite(
|
|
243293
|
+
return await deploySite(join12(resolvedPath, outputDirectory));
|
|
243342
243294
|
}, {
|
|
243343
243295
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
243344
243296
|
errorMessage: "Failed to deploy site"
|
|
@@ -243440,7 +243392,7 @@ ${summaryLines.join(`
|
|
|
243440
243392
|
}
|
|
243441
243393
|
return { outroMessage: "App deployed successfully" };
|
|
243442
243394
|
}
|
|
243443
|
-
function
|
|
243395
|
+
function getDeployCommand(context) {
|
|
243444
243396
|
return new Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
|
|
243445
243397
|
await runCommand(() => deployAction({
|
|
243446
243398
|
...options,
|
|
@@ -243964,10 +243916,10 @@ function toPascalCase(name2) {
|
|
|
243964
243916
|
return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
|
|
243965
243917
|
}
|
|
243966
243918
|
// src/core/types/update-project.ts
|
|
243967
|
-
import { join as
|
|
243919
|
+
import { join as join15 } from "node:path";
|
|
243968
243920
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
243969
243921
|
async function updateProjectConfig(projectRoot) {
|
|
243970
|
-
const tsconfigPath =
|
|
243922
|
+
const tsconfigPath = join15(projectRoot, "tsconfig.json");
|
|
243971
243923
|
if (!await pathExists(tsconfigPath)) {
|
|
243972
243924
|
return false;
|
|
243973
243925
|
}
|
|
@@ -244010,7 +243962,7 @@ function getTypesCommand(context) {
|
|
|
244010
243962
|
}
|
|
244011
243963
|
|
|
244012
243964
|
// src/cli/dev/dev-server/main.ts
|
|
244013
|
-
import { dirname as
|
|
243965
|
+
import { dirname as dirname13, join as join18 } from "node:path";
|
|
244014
243966
|
var import_cors = __toESM(require_lib4(), 1);
|
|
244015
243967
|
var import_express4 = __toESM(require_express(), 1);
|
|
244016
243968
|
|
|
@@ -244169,10 +244121,6 @@ function createDevLogger() {
|
|
|
244169
244121
|
|
|
244170
244122
|
// src/cli/dev/dev-server/function-manager.ts
|
|
244171
244123
|
import { spawn as spawn2, spawnSync as spawnSync2 } from "node:child_process";
|
|
244172
|
-
import { dirname as dirname12, join as join15 } from "node:path";
|
|
244173
|
-
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
244174
|
-
var __dirname5 = dirname12(fileURLToPath7(import.meta.url));
|
|
244175
|
-
var WRAPPER_PATH = join15(__dirname5, "../deno-runtime/main.js");
|
|
244176
244124
|
var READY_TIMEOUT = 30000;
|
|
244177
244125
|
|
|
244178
244126
|
class FunctionManager {
|
|
@@ -244180,9 +244128,11 @@ class FunctionManager {
|
|
|
244180
244128
|
running = new Map;
|
|
244181
244129
|
starting = new Map;
|
|
244182
244130
|
logger;
|
|
244183
|
-
|
|
244131
|
+
wrapperPath;
|
|
244132
|
+
constructor(functions, logger, wrapperPath) {
|
|
244184
244133
|
this.functions = new Map(functions.map((f7) => [f7.name, f7]));
|
|
244185
244134
|
this.logger = logger;
|
|
244135
|
+
this.wrapperPath = wrapperPath;
|
|
244186
244136
|
if (functions.length > 0) {
|
|
244187
244137
|
this.verifyDenoIsInstalled();
|
|
244188
244138
|
}
|
|
@@ -244255,7 +244205,7 @@ class FunctionManager {
|
|
|
244255
244205
|
}
|
|
244256
244206
|
spawnFunction(func, port) {
|
|
244257
244207
|
this.logger.log(`Spawning function "${func.name}" on port ${port}`);
|
|
244258
|
-
const process21 = spawn2("deno", ["run", "--allow-all",
|
|
244208
|
+
const process21 = spawn2("deno", ["run", "--allow-all", this.wrapperPath], {
|
|
244259
244209
|
env: {
|
|
244260
244210
|
...globalThis.process.env,
|
|
244261
244211
|
FUNCTION_PATH: func.entryPath,
|
|
@@ -245476,9 +245426,9 @@ class NodeFsHandler {
|
|
|
245476
245426
|
if (this.fsw.closed) {
|
|
245477
245427
|
return;
|
|
245478
245428
|
}
|
|
245479
|
-
const
|
|
245429
|
+
const dirname12 = sp2.dirname(file2);
|
|
245480
245430
|
const basename5 = sp2.basename(file2);
|
|
245481
|
-
const parent = this.fsw._getWatchedDir(
|
|
245431
|
+
const parent = this.fsw._getWatchedDir(dirname12);
|
|
245482
245432
|
let prevStats = stats;
|
|
245483
245433
|
if (parent.has(basename5))
|
|
245484
245434
|
return;
|
|
@@ -245505,7 +245455,7 @@ class NodeFsHandler {
|
|
|
245505
245455
|
prevStats = newStats2;
|
|
245506
245456
|
}
|
|
245507
245457
|
} catch (error48) {
|
|
245508
|
-
this.fsw._remove(
|
|
245458
|
+
this.fsw._remove(dirname12, basename5);
|
|
245509
245459
|
}
|
|
245510
245460
|
} else if (parent.has(basename5)) {
|
|
245511
245461
|
const at13 = newStats.atimeMs;
|
|
@@ -246466,7 +246416,7 @@ async function createDevServer(options8) {
|
|
|
246466
246416
|
next();
|
|
246467
246417
|
});
|
|
246468
246418
|
const devLogger = createDevLogger();
|
|
246469
|
-
const functionManager = new FunctionManager(functions, devLogger);
|
|
246419
|
+
const functionManager = new FunctionManager(functions, devLogger, options8.denoWrapperPath);
|
|
246470
246420
|
const functionRoutes = createFunctionRouter(functionManager, devLogger);
|
|
246471
246421
|
app.use("/api/apps/:appId/functions", functionRoutes);
|
|
246472
246422
|
if (functionManager.getFunctionNames().length > 0) {
|
|
@@ -246508,8 +246458,8 @@ async function createDevServer(options8) {
|
|
|
246508
246458
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
246509
246459
|
};
|
|
246510
246460
|
const base44ConfigWatcher = new WatchBase44({
|
|
246511
|
-
functions: join18(
|
|
246512
|
-
entities: join18(
|
|
246461
|
+
functions: join18(dirname13(project2.configPath), project2.functionsDir),
|
|
246462
|
+
entities: join18(dirname13(project2.configPath), project2.entitiesDir)
|
|
246513
246463
|
}, devLogger);
|
|
246514
246464
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
246515
246465
|
try {
|
|
@@ -246557,6 +246507,7 @@ async function devAction(options8) {
|
|
|
246557
246507
|
const port = options8.port ? Number(options8.port) : undefined;
|
|
246558
246508
|
const { port: resolvedPort } = await createDevServer({
|
|
246559
246509
|
port,
|
|
246510
|
+
denoWrapperPath: getDenoWrapperPath(),
|
|
246560
246511
|
loadResources: async () => {
|
|
246561
246512
|
const { functions, entities, project: project2 } = await readProjectConfig();
|
|
246562
246513
|
return { functions, entities, project: project2 };
|
|
@@ -246678,13 +246629,13 @@ function createProgram(context) {
|
|
|
246678
246629
|
program2.addCommand(getLogoutCommand(context));
|
|
246679
246630
|
program2.addCommand(getCreateCommand(context));
|
|
246680
246631
|
program2.addCommand(getDashboardCommand(context));
|
|
246681
|
-
program2.addCommand(
|
|
246632
|
+
program2.addCommand(getDeployCommand(context));
|
|
246682
246633
|
program2.addCommand(getLinkCommand(context));
|
|
246683
246634
|
program2.addCommand(getEjectCommand(context));
|
|
246684
246635
|
program2.addCommand(getEntitiesPushCommand(context));
|
|
246685
246636
|
program2.addCommand(getAgentsCommand(context));
|
|
246686
246637
|
program2.addCommand(getConnectorsCommand(context));
|
|
246687
|
-
program2.addCommand(
|
|
246638
|
+
program2.addCommand(getFunctionsDeployCommand(context));
|
|
246688
246639
|
program2.addCommand(getSecretsCommand(context));
|
|
246689
246640
|
program2.addCommand(getSiteCommand(context));
|
|
246690
246641
|
program2.addCommand(getTypesCommand(context));
|
|
@@ -246698,7 +246649,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
246698
246649
|
import { release, type } from "node:os";
|
|
246699
246650
|
|
|
246700
246651
|
// node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
246701
|
-
import { dirname as
|
|
246652
|
+
import { dirname as dirname14, posix, sep } from "path";
|
|
246702
246653
|
function createModulerModifier() {
|
|
246703
246654
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
246704
246655
|
return async (frames) => {
|
|
@@ -246707,7 +246658,7 @@ function createModulerModifier() {
|
|
|
246707
246658
|
return frames;
|
|
246708
246659
|
};
|
|
246709
246660
|
}
|
|
246710
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
246661
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname14(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
246711
246662
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
246712
246663
|
return (filename) => {
|
|
246713
246664
|
if (!filename)
|
|
@@ -250896,11 +250847,16 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
|
|
|
250896
250847
|
});
|
|
250897
250848
|
}
|
|
250898
250849
|
// src/cli/index.ts
|
|
250850
|
+
var __dirname4 = dirname15(fileURLToPath6(import.meta.url));
|
|
250899
250851
|
async function runCLI() {
|
|
250852
|
+
ensureNpmAssets(join19(__dirname4, "../assets"));
|
|
250900
250853
|
const errorReporter = new ErrorReporter;
|
|
250901
250854
|
errorReporter.registerProcessErrorHandlers();
|
|
250902
250855
|
const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
|
|
250903
|
-
const context = {
|
|
250856
|
+
const context = {
|
|
250857
|
+
errorReporter,
|
|
250858
|
+
isNonInteractive
|
|
250859
|
+
};
|
|
250904
250860
|
const program2 = createProgram(context);
|
|
250905
250861
|
try {
|
|
250906
250862
|
const userInfo = await readAuth();
|
|
@@ -250925,4 +250881,4 @@ export {
|
|
|
250925
250881
|
CLIExitError
|
|
250926
250882
|
};
|
|
250927
250883
|
|
|
250928
|
-
//# debugId=
|
|
250884
|
+
//# debugId=9E9726773409F01264756E2164756E21
|