@base44-preview/cli 0.0.54-pr.537.b493243 → 0.0.54-pr.537.c244cf6
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 +288 -198
- package/dist/cli/index.js.map +12 -11
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -12980,10 +12980,10 @@ var require_ejs = __commonJS((exports) => {
|
|
|
12980
12980
|
exports.localsName = _DEFAULT_LOCALS_NAME;
|
|
12981
12981
|
exports.promiseImpl = new Function("return this;")().Promise;
|
|
12982
12982
|
exports.resolveInclude = function(name2, filename, isDir) {
|
|
12983
|
-
var
|
|
12983
|
+
var dirname8 = path11.dirname;
|
|
12984
12984
|
var extname = path11.extname;
|
|
12985
12985
|
var resolve2 = path11.resolve;
|
|
12986
|
-
var includePath = resolve2(isDir ? filename :
|
|
12986
|
+
var includePath = resolve2(isDir ? filename : dirname8(filename), name2);
|
|
12987
12987
|
var ext = extname(name2);
|
|
12988
12988
|
if (!ext) {
|
|
12989
12989
|
includePath += ".ejs";
|
|
@@ -122718,12 +122718,12 @@ function getLanguageByFileName(languages2, file2) {
|
|
|
122718
122718
|
if (!file2) {
|
|
122719
122719
|
return;
|
|
122720
122720
|
}
|
|
122721
|
-
const
|
|
122721
|
+
const basename5 = getFileBasename(file2).toLowerCase();
|
|
122722
122722
|
return languages2.find(({
|
|
122723
122723
|
filenames
|
|
122724
|
-
}) => filenames?.some((name2) => name2.toLowerCase() ===
|
|
122724
|
+
}) => filenames?.some((name2) => name2.toLowerCase() === basename5)) ?? languages2.find(({
|
|
122725
122725
|
extensions
|
|
122726
|
-
}) => extensions?.some((extension) =>
|
|
122726
|
+
}) => extensions?.some((extension) => basename5.endsWith(extension)));
|
|
122727
122727
|
}
|
|
122728
122728
|
function getLanguageByLanguageName(languages2, languageName) {
|
|
122729
122729
|
if (!languageName) {
|
|
@@ -127945,8 +127945,8 @@ var init_prettier = __esm(() => {
|
|
|
127945
127945
|
}
|
|
127946
127946
|
exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
127947
127947
|
function isAffectDepthOfReadingPattern(pattern) {
|
|
127948
|
-
const
|
|
127949
|
-
return endsWithSlashGlobStar(pattern) || isStaticPattern(
|
|
127948
|
+
const basename5 = path152.basename(pattern);
|
|
127949
|
+
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename5);
|
|
127950
127950
|
}
|
|
127951
127951
|
exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
127952
127952
|
function expandPatternsWithBraceExpansion(patterns) {
|
|
@@ -138269,11 +138269,11 @@ var require_prettier = __commonJS((exports, module) => {
|
|
|
138269
138269
|
var require_formatter = __commonJS((exports) => {
|
|
138270
138270
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
|
|
138271
138271
|
function adopt(value) {
|
|
138272
|
-
return value instanceof P9 ? value : new P9(function(
|
|
138273
|
-
|
|
138272
|
+
return value instanceof P9 ? value : new P9(function(resolve10) {
|
|
138273
|
+
resolve10(value);
|
|
138274
138274
|
});
|
|
138275
138275
|
}
|
|
138276
|
-
return new (P9 || (P9 = Promise))(function(
|
|
138276
|
+
return new (P9 || (P9 = Promise))(function(resolve10, reject) {
|
|
138277
138277
|
function fulfilled(value) {
|
|
138278
138278
|
try {
|
|
138279
138279
|
step(generator.next(value));
|
|
@@ -138289,7 +138289,7 @@ var require_formatter = __commonJS((exports) => {
|
|
|
138289
138289
|
}
|
|
138290
138290
|
}
|
|
138291
138291
|
function step(result) {
|
|
138292
|
-
result.done ?
|
|
138292
|
+
result.done ? resolve10(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
138293
138293
|
}
|
|
138294
138294
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
138295
138295
|
});
|
|
@@ -142942,7 +142942,7 @@ var require_url = __commonJS((exports) => {
|
|
|
142942
142942
|
};
|
|
142943
142943
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
142944
142944
|
exports.parse = undefined;
|
|
142945
|
-
exports.resolve =
|
|
142945
|
+
exports.resolve = resolve10;
|
|
142946
142946
|
exports.cwd = cwd;
|
|
142947
142947
|
exports.getProtocol = getProtocol;
|
|
142948
142948
|
exports.getExtension = getExtension;
|
|
@@ -142970,7 +142970,7 @@ var require_url = __commonJS((exports) => {
|
|
|
142970
142970
|
var urlDecodePatterns = [/%23/g, "#", /%24/g, "$", /%26/g, "&", /%2C/g, ",", /%40/g, "@"];
|
|
142971
142971
|
var parse11 = (u4) => new URL(u4);
|
|
142972
142972
|
exports.parse = parse11;
|
|
142973
|
-
function
|
|
142973
|
+
function resolve10(from, to5) {
|
|
142974
142974
|
const fromUrl = new URL((0, convert_path_to_posix_1.default)(from), "https://aaa.nonexistanturl.com");
|
|
142975
142975
|
const resolvedUrl = new URL((0, convert_path_to_posix_1.default)(to5), fromUrl);
|
|
142976
142976
|
const endSpaces = to5.match(/(\s*)$/)?.[1] || "";
|
|
@@ -143106,7 +143106,7 @@ var require_url = __commonJS((exports) => {
|
|
|
143106
143106
|
}
|
|
143107
143107
|
function relative4(from, to5) {
|
|
143108
143108
|
if (!isFileSystemPath(from) || !isFileSystemPath(to5)) {
|
|
143109
|
-
return
|
|
143109
|
+
return resolve10(from, to5);
|
|
143110
143110
|
}
|
|
143111
143111
|
const fromDir = path_1.default.dirname(stripHash(from));
|
|
143112
143112
|
const toPath4 = stripHash(to5);
|
|
@@ -143782,7 +143782,7 @@ var require_plugins = __commonJS((exports) => {
|
|
|
143782
143782
|
let plugin;
|
|
143783
143783
|
let lastError;
|
|
143784
143784
|
let index = 0;
|
|
143785
|
-
return new Promise((
|
|
143785
|
+
return new Promise((resolve10, reject) => {
|
|
143786
143786
|
runNextPlugin();
|
|
143787
143787
|
function runNextPlugin() {
|
|
143788
143788
|
plugin = plugins[index++];
|
|
@@ -143810,7 +143810,7 @@ var require_plugins = __commonJS((exports) => {
|
|
|
143810
143810
|
}
|
|
143811
143811
|
}
|
|
143812
143812
|
function onSuccess(result) {
|
|
143813
|
-
|
|
143813
|
+
resolve10({
|
|
143814
143814
|
plugin,
|
|
143815
143815
|
result
|
|
143816
143816
|
});
|
|
@@ -145143,11 +145143,11 @@ var require_lib3 = __commonJS((exports) => {
|
|
|
145143
145143
|
var require_resolver = __commonJS((exports) => {
|
|
145144
145144
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
|
|
145145
145145
|
function adopt(value) {
|
|
145146
|
-
return value instanceof P9 ? value : new P9(function(
|
|
145147
|
-
|
|
145146
|
+
return value instanceof P9 ? value : new P9(function(resolve10) {
|
|
145147
|
+
resolve10(value);
|
|
145148
145148
|
});
|
|
145149
145149
|
}
|
|
145150
|
-
return new (P9 || (P9 = Promise))(function(
|
|
145150
|
+
return new (P9 || (P9 = Promise))(function(resolve10, reject) {
|
|
145151
145151
|
function fulfilled(value) {
|
|
145152
145152
|
try {
|
|
145153
145153
|
step(generator.next(value));
|
|
@@ -145163,7 +145163,7 @@ var require_resolver = __commonJS((exports) => {
|
|
|
145163
145163
|
}
|
|
145164
145164
|
}
|
|
145165
145165
|
function step(result) {
|
|
145166
|
-
result.done ?
|
|
145166
|
+
result.done ? resolve10(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
145167
145167
|
}
|
|
145168
145168
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
145169
145169
|
});
|
|
@@ -145284,11 +145284,11 @@ var require_optionValidator = __commonJS((exports) => {
|
|
|
145284
145284
|
var require_src3 = __commonJS((exports) => {
|
|
145285
145285
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
|
|
145286
145286
|
function adopt(value) {
|
|
145287
|
-
return value instanceof P9 ? value : new P9(function(
|
|
145288
|
-
|
|
145287
|
+
return value instanceof P9 ? value : new P9(function(resolve10) {
|
|
145288
|
+
resolve10(value);
|
|
145289
145289
|
});
|
|
145290
145290
|
}
|
|
145291
|
-
return new (P9 || (P9 = Promise))(function(
|
|
145291
|
+
return new (P9 || (P9 = Promise))(function(resolve10, reject) {
|
|
145292
145292
|
function fulfilled(value) {
|
|
145293
145293
|
try {
|
|
145294
145294
|
step(generator.next(value));
|
|
@@ -145304,7 +145304,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
145304
145304
|
}
|
|
145305
145305
|
}
|
|
145306
145306
|
function step(result) {
|
|
145307
|
-
result.done ?
|
|
145307
|
+
result.done ? resolve10(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
145308
145308
|
}
|
|
145309
145309
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
145310
145310
|
});
|
|
@@ -150819,11 +150819,11 @@ var require_raw_body = __commonJS((exports, module) => {
|
|
|
150819
150819
|
if (done) {
|
|
150820
150820
|
return readStream(stream, encoding, length, limit, wrap(done));
|
|
150821
150821
|
}
|
|
150822
|
-
return new Promise(function executor(
|
|
150822
|
+
return new Promise(function executor(resolve10, reject) {
|
|
150823
150823
|
readStream(stream, encoding, length, limit, function onRead2(err, buf) {
|
|
150824
150824
|
if (err)
|
|
150825
150825
|
return reject(err);
|
|
150826
|
-
|
|
150826
|
+
resolve10(buf);
|
|
150827
150827
|
});
|
|
150828
150828
|
});
|
|
150829
150829
|
}
|
|
@@ -163944,11 +163944,11 @@ var require_view = __commonJS((exports, module) => {
|
|
|
163944
163944
|
var debug = require_src4()("express:view");
|
|
163945
163945
|
var path18 = __require("node:path");
|
|
163946
163946
|
var fs28 = __require("node:fs");
|
|
163947
|
-
var
|
|
163948
|
-
var
|
|
163947
|
+
var dirname18 = path18.dirname;
|
|
163948
|
+
var basename5 = path18.basename;
|
|
163949
163949
|
var extname2 = path18.extname;
|
|
163950
163950
|
var join25 = path18.join;
|
|
163951
|
-
var
|
|
163951
|
+
var resolve10 = path18.resolve;
|
|
163952
163952
|
module.exports = View;
|
|
163953
163953
|
function View(name2, options8) {
|
|
163954
163954
|
var opts = options8 || {};
|
|
@@ -163982,9 +163982,9 @@ var require_view = __commonJS((exports, module) => {
|
|
|
163982
163982
|
debug('lookup "%s"', name2);
|
|
163983
163983
|
for (var i5 = 0;i5 < roots.length && !path19; i5++) {
|
|
163984
163984
|
var root2 = roots[i5];
|
|
163985
|
-
var loc =
|
|
163986
|
-
var dir =
|
|
163987
|
-
var file2 =
|
|
163985
|
+
var loc = resolve10(root2, name2);
|
|
163986
|
+
var dir = dirname18(loc);
|
|
163987
|
+
var file2 = basename5(loc);
|
|
163988
163988
|
path19 = this.resolve(dir, file2);
|
|
163989
163989
|
}
|
|
163990
163990
|
return path19;
|
|
@@ -164007,14 +164007,14 @@ var require_view = __commonJS((exports, module) => {
|
|
|
164007
164007
|
});
|
|
164008
164008
|
sync = false;
|
|
164009
164009
|
};
|
|
164010
|
-
View.prototype.resolve = function
|
|
164010
|
+
View.prototype.resolve = function resolve11(dir, file2) {
|
|
164011
164011
|
var ext = this.ext;
|
|
164012
164012
|
var path19 = join25(dir, file2);
|
|
164013
164013
|
var stat2 = tryStat(path19);
|
|
164014
164014
|
if (stat2 && stat2.isFile()) {
|
|
164015
164015
|
return path19;
|
|
164016
164016
|
}
|
|
164017
|
-
path19 = join25(dir,
|
|
164017
|
+
path19 = join25(dir, basename5(file2, ext), "index" + ext);
|
|
164018
164018
|
stat2 = tryStat(path19);
|
|
164019
164019
|
if (stat2 && stat2.isFile()) {
|
|
164020
164020
|
return path19;
|
|
@@ -166166,7 +166166,7 @@ var require_application = __commonJS((exports, module) => {
|
|
|
166166
166166
|
var compileETag = require_utils10().compileETag;
|
|
166167
166167
|
var compileQueryParser = require_utils10().compileQueryParser;
|
|
166168
166168
|
var compileTrust = require_utils10().compileTrust;
|
|
166169
|
-
var
|
|
166169
|
+
var resolve10 = __require("node:path").resolve;
|
|
166170
166170
|
var once9 = require_once();
|
|
166171
166171
|
var Router = require_router();
|
|
166172
166172
|
var slice = Array.prototype.slice;
|
|
@@ -166220,7 +166220,7 @@ var require_application = __commonJS((exports, module) => {
|
|
|
166220
166220
|
this.mountpath = "/";
|
|
166221
166221
|
this.locals.settings = this.settings;
|
|
166222
166222
|
this.set("view", View);
|
|
166223
|
-
this.set("views",
|
|
166223
|
+
this.set("views", resolve10("views"));
|
|
166224
166224
|
this.set("jsonp callback name", "callback");
|
|
166225
166225
|
if (env3 === "production") {
|
|
166226
166226
|
this.enable("view cache");
|
|
@@ -167335,7 +167335,7 @@ var require_content_disposition = __commonJS((exports, module) => {
|
|
|
167335
167335
|
*/
|
|
167336
167336
|
module.exports = contentDisposition;
|
|
167337
167337
|
module.exports.parse = parse11;
|
|
167338
|
-
var
|
|
167338
|
+
var basename5 = __require("path").basename;
|
|
167339
167339
|
var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;
|
|
167340
167340
|
var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/;
|
|
167341
167341
|
var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g;
|
|
@@ -167370,9 +167370,9 @@ var require_content_disposition = __commonJS((exports, module) => {
|
|
|
167370
167370
|
if (typeof fallback === "string" && NON_LATIN1_REGEXP.test(fallback)) {
|
|
167371
167371
|
throw new TypeError("fallback must be ISO-8859-1 string");
|
|
167372
167372
|
}
|
|
167373
|
-
var name2 =
|
|
167373
|
+
var name2 = basename5(filename);
|
|
167374
167374
|
var isQuotedString = TEXT_REGEXP.test(name2);
|
|
167375
|
-
var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name2) :
|
|
167375
|
+
var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name2) : basename5(fallback);
|
|
167376
167376
|
var hasFallback = typeof fallbackName === "string" && fallbackName !== name2;
|
|
167377
167377
|
if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name2)) {
|
|
167378
167378
|
params["filename*"] = name2;
|
|
@@ -167711,7 +167711,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
167711
167711
|
var extname2 = path18.extname;
|
|
167712
167712
|
var join25 = path18.join;
|
|
167713
167713
|
var normalize2 = path18.normalize;
|
|
167714
|
-
var
|
|
167714
|
+
var resolve10 = path18.resolve;
|
|
167715
167715
|
var sep = path18.sep;
|
|
167716
167716
|
var BYTES_RANGE_REGEXP = /^ *bytes=/;
|
|
167717
167717
|
var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000;
|
|
@@ -167740,7 +167740,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
167740
167740
|
this._maxage = opts.maxAge || opts.maxage;
|
|
167741
167741
|
this._maxage = typeof this._maxage === "string" ? ms8(this._maxage) : Number(this._maxage);
|
|
167742
167742
|
this._maxage = !isNaN(this._maxage) ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) : 0;
|
|
167743
|
-
this._root = opts.root ?
|
|
167743
|
+
this._root = opts.root ? resolve10(opts.root) : null;
|
|
167744
167744
|
}
|
|
167745
167745
|
util2.inherits(SendStream, Stream2);
|
|
167746
167746
|
SendStream.prototype.error = function error48(status, err) {
|
|
@@ -167889,7 +167889,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
167889
167889
|
return res;
|
|
167890
167890
|
}
|
|
167891
167891
|
parts = normalize2(path19).split(sep);
|
|
167892
|
-
path19 =
|
|
167892
|
+
path19 = resolve10(path19);
|
|
167893
167893
|
}
|
|
167894
167894
|
if (containsDotFile(parts)) {
|
|
167895
167895
|
debug('%s dotfile "%s"', this._dotfiles, path19);
|
|
@@ -168217,7 +168217,7 @@ var require_response = __commonJS((exports, module) => {
|
|
|
168217
168217
|
var cookie = require_cookie();
|
|
168218
168218
|
var send = require_send();
|
|
168219
168219
|
var extname2 = path18.extname;
|
|
168220
|
-
var
|
|
168220
|
+
var resolve10 = path18.resolve;
|
|
168221
168221
|
var vary = require_vary();
|
|
168222
168222
|
var { Buffer: Buffer7 } = __require("node:buffer");
|
|
168223
168223
|
var res = Object.create(http.ServerResponse.prototype);
|
|
@@ -168426,7 +168426,7 @@ var require_response = __commonJS((exports, module) => {
|
|
|
168426
168426
|
}
|
|
168427
168427
|
opts = Object.create(opts);
|
|
168428
168428
|
opts.headers = headers;
|
|
168429
|
-
var fullPath = !opts.root ?
|
|
168429
|
+
var fullPath = !opts.root ? resolve10(path19) : path19;
|
|
168430
168430
|
return this.sendFile(fullPath, opts, done);
|
|
168431
168431
|
};
|
|
168432
168432
|
res.contentType = res.type = function contentType(type) {
|
|
@@ -168687,7 +168687,7 @@ var require_serve_static = __commonJS((exports, module) => {
|
|
|
168687
168687
|
var encodeUrl = require_encodeurl();
|
|
168688
168688
|
var escapeHtml = require_escape_html();
|
|
168689
168689
|
var parseUrl = require_parseurl();
|
|
168690
|
-
var
|
|
168690
|
+
var resolve10 = __require("path").resolve;
|
|
168691
168691
|
var send = require_send();
|
|
168692
168692
|
var url3 = __require("url");
|
|
168693
168693
|
module.exports = serveStatic;
|
|
@@ -168706,7 +168706,7 @@ var require_serve_static = __commonJS((exports, module) => {
|
|
|
168706
168706
|
throw new TypeError("option setHeaders must be function");
|
|
168707
168707
|
}
|
|
168708
168708
|
opts.maxage = opts.maxage || opts.maxAge || 0;
|
|
168709
|
-
opts.root =
|
|
168709
|
+
opts.root = resolve10(root2);
|
|
168710
168710
|
var onDirectory = redirect ? createRedirectDirectoryListener() : createNotFoundDirectoryListener();
|
|
168711
168711
|
return function serveStatic2(req, res, next) {
|
|
168712
168712
|
if (req.method !== "GET" && req.method !== "HEAD") {
|
|
@@ -171269,8 +171269,8 @@ var require_tmp = __commonJS((exports, module) => {
|
|
|
171269
171269
|
const name2 = options8.name;
|
|
171270
171270
|
if (path18.isAbsolute(name2))
|
|
171271
171271
|
throw new Error(`name option must not contain an absolute path, found "${name2}".`);
|
|
171272
|
-
const
|
|
171273
|
-
if (
|
|
171272
|
+
const basename5 = path18.basename(name2);
|
|
171273
|
+
if (basename5 === ".." || basename5 === "." || basename5 !== name2)
|
|
171274
171274
|
throw new Error(`name option must not contain a path, found "${name2}".`);
|
|
171275
171275
|
}
|
|
171276
171276
|
if (!_isUndefined(options8.template) && !options8.template.match(TEMPLATE_PATTERN)) {
|
|
@@ -172080,8 +172080,8 @@ var require_executor = __commonJS((exports, module) => {
|
|
|
172080
172080
|
}
|
|
172081
172081
|
resetBuffer() {
|
|
172082
172082
|
this.buffer = new Waterfall;
|
|
172083
|
-
this.buffer.chain(new Promise((
|
|
172084
|
-
this._triggerBuffer =
|
|
172083
|
+
this.buffer.chain(new Promise((resolve10) => {
|
|
172084
|
+
this._triggerBuffer = resolve10;
|
|
172085
172085
|
}));
|
|
172086
172086
|
if (this.ready)
|
|
172087
172087
|
this._triggerBuffer();
|
|
@@ -173101,7 +173101,7 @@ var require_storage = __commonJS((exports, module) => {
|
|
|
173101
173101
|
throw e8;
|
|
173102
173102
|
}
|
|
173103
173103
|
};
|
|
173104
|
-
var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((
|
|
173104
|
+
var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((resolve10, reject) => {
|
|
173105
173105
|
try {
|
|
173106
173106
|
const stream = writeFileStream(filename, { mode });
|
|
173107
173107
|
const readable2 = Readable6.from(lines);
|
|
@@ -173118,7 +173118,7 @@ var require_storage = __commonJS((exports, module) => {
|
|
|
173118
173118
|
if (err)
|
|
173119
173119
|
reject(err);
|
|
173120
173120
|
else
|
|
173121
|
-
|
|
173121
|
+
resolve10();
|
|
173122
173122
|
});
|
|
173123
173123
|
});
|
|
173124
173124
|
readable2.on("error", (err) => {
|
|
@@ -173289,7 +173289,7 @@ var require_persistence = __commonJS((exports, module) => {
|
|
|
173289
173289
|
return { data: tdata, indexes };
|
|
173290
173290
|
}
|
|
173291
173291
|
treatRawStreamAsync(rawStream) {
|
|
173292
|
-
return new Promise((
|
|
173292
|
+
return new Promise((resolve10, reject) => {
|
|
173293
173293
|
const dataById = {};
|
|
173294
173294
|
const indexes = {};
|
|
173295
173295
|
let corruptItems = 0;
|
|
@@ -173332,7 +173332,7 @@ var require_persistence = __commonJS((exports, module) => {
|
|
|
173332
173332
|
}
|
|
173333
173333
|
}
|
|
173334
173334
|
const data = Object.values(dataById);
|
|
173335
|
-
|
|
173335
|
+
resolve10({ data, indexes });
|
|
173336
173336
|
});
|
|
173337
173337
|
lineStream.on("error", function(err) {
|
|
173338
173338
|
reject(err, null);
|
|
@@ -198943,13 +198943,13 @@ var require_broadcast_operator = __commonJS((exports) => {
|
|
|
198943
198943
|
return true;
|
|
198944
198944
|
}
|
|
198945
198945
|
emitWithAck(ev2, ...args) {
|
|
198946
|
-
return new Promise((
|
|
198946
|
+
return new Promise((resolve10, reject) => {
|
|
198947
198947
|
args.push((err, responses) => {
|
|
198948
198948
|
if (err) {
|
|
198949
198949
|
err.responses = responses;
|
|
198950
198950
|
return reject(err);
|
|
198951
198951
|
} else {
|
|
198952
|
-
return
|
|
198952
|
+
return resolve10(responses);
|
|
198953
198953
|
}
|
|
198954
198954
|
});
|
|
198955
198955
|
this.emit(ev2, ...args);
|
|
@@ -199137,12 +199137,12 @@ var require_socket2 = __commonJS((exports) => {
|
|
|
199137
199137
|
}
|
|
199138
199138
|
emitWithAck(ev2, ...args) {
|
|
199139
199139
|
const withErr = this.flags.timeout !== undefined;
|
|
199140
|
-
return new Promise((
|
|
199140
|
+
return new Promise((resolve10, reject) => {
|
|
199141
199141
|
args.push((arg1, arg2) => {
|
|
199142
199142
|
if (withErr) {
|
|
199143
|
-
return arg1 ? reject(arg1) :
|
|
199143
|
+
return arg1 ? reject(arg1) : resolve10(arg2);
|
|
199144
199144
|
} else {
|
|
199145
|
-
return
|
|
199145
|
+
return resolve10(arg1);
|
|
199146
199146
|
}
|
|
199147
199147
|
});
|
|
199148
199148
|
this.emit(ev2, ...args);
|
|
@@ -199597,13 +199597,13 @@ var require_namespace = __commonJS((exports) => {
|
|
|
199597
199597
|
return true;
|
|
199598
199598
|
}
|
|
199599
199599
|
serverSideEmitWithAck(ev2, ...args) {
|
|
199600
|
-
return new Promise((
|
|
199600
|
+
return new Promise((resolve10, reject) => {
|
|
199601
199601
|
args.push((err, responses) => {
|
|
199602
199602
|
if (err) {
|
|
199603
199603
|
err.responses = responses;
|
|
199604
199604
|
return reject(err);
|
|
199605
199605
|
} else {
|
|
199606
|
-
return
|
|
199606
|
+
return resolve10(responses);
|
|
199607
199607
|
}
|
|
199608
199608
|
});
|
|
199609
199609
|
this.serverSideEmit(ev2, ...args);
|
|
@@ -200287,7 +200287,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
200287
200287
|
return localSockets;
|
|
200288
200288
|
}
|
|
200289
200289
|
const requestId = randomId();
|
|
200290
|
-
return new Promise((
|
|
200290
|
+
return new Promise((resolve10, reject) => {
|
|
200291
200291
|
const timeout3 = setTimeout(() => {
|
|
200292
200292
|
const storedRequest2 = this.requests.get(requestId);
|
|
200293
200293
|
if (storedRequest2) {
|
|
@@ -200297,7 +200297,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
200297
200297
|
}, opts.flags.timeout || DEFAULT_TIMEOUT);
|
|
200298
200298
|
const storedRequest = {
|
|
200299
200299
|
type: MessageType.FETCH_SOCKETS,
|
|
200300
|
-
resolve:
|
|
200300
|
+
resolve: resolve10,
|
|
200301
200301
|
timeout: timeout3,
|
|
200302
200302
|
current: 0,
|
|
200303
200303
|
expected: expectedResponseCount,
|
|
@@ -200507,7 +200507,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
200507
200507
|
return localSockets;
|
|
200508
200508
|
}
|
|
200509
200509
|
const requestId = randomId();
|
|
200510
|
-
return new Promise((
|
|
200510
|
+
return new Promise((resolve10, reject) => {
|
|
200511
200511
|
const timeout3 = setTimeout(() => {
|
|
200512
200512
|
const storedRequest2 = this.customRequests.get(requestId);
|
|
200513
200513
|
if (storedRequest2) {
|
|
@@ -200517,7 +200517,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
200517
200517
|
}, opts.flags.timeout || DEFAULT_TIMEOUT);
|
|
200518
200518
|
const storedRequest = {
|
|
200519
200519
|
type: MessageType.FETCH_SOCKETS,
|
|
200520
|
-
resolve:
|
|
200520
|
+
resolve: resolve10,
|
|
200521
200521
|
timeout: timeout3,
|
|
200522
200522
|
missingUids: new Set([...this.nodesMap.keys()]),
|
|
200523
200523
|
responses: localSockets
|
|
@@ -201246,13 +201246,13 @@ var require_dist4 = __commonJS((exports, module) => {
|
|
|
201246
201246
|
this.engine.close();
|
|
201247
201247
|
(0, uws_1.restoreAdapter)();
|
|
201248
201248
|
if (this.httpServer) {
|
|
201249
|
-
return new Promise((
|
|
201249
|
+
return new Promise((resolve10) => {
|
|
201250
201250
|
this.httpServer.close((err) => {
|
|
201251
201251
|
fn9 && fn9(err);
|
|
201252
201252
|
if (err) {
|
|
201253
201253
|
debug("server was not running");
|
|
201254
201254
|
}
|
|
201255
|
-
|
|
201255
|
+
resolve10();
|
|
201256
201256
|
});
|
|
201257
201257
|
});
|
|
201258
201258
|
} else {
|
|
@@ -210550,7 +210550,7 @@ var require_utils12 = __commonJS((exports, module) => {
|
|
|
210550
210550
|
if (decode4)
|
|
210551
210551
|
return decode4(data, hint);
|
|
210552
210552
|
}
|
|
210553
|
-
function
|
|
210553
|
+
function basename5(path18) {
|
|
210554
210554
|
if (typeof path18 !== "string")
|
|
210555
210555
|
return "";
|
|
210556
210556
|
for (let i5 = path18.length - 1;i5 >= 0; --i5) {
|
|
@@ -211854,7 +211854,7 @@ var require_utils12 = __commonJS((exports, module) => {
|
|
|
211854
211854
|
-1
|
|
211855
211855
|
];
|
|
211856
211856
|
module.exports = {
|
|
211857
|
-
basename:
|
|
211857
|
+
basename: basename5,
|
|
211858
211858
|
convertToUTF8,
|
|
211859
211859
|
getDecoder,
|
|
211860
211860
|
parseContentType,
|
|
@@ -212262,7 +212262,7 @@ var require_multipart = __commonJS((exports, module) => {
|
|
|
212262
212262
|
var { Readable: Readable6, Writable: Writable4 } = __require("stream");
|
|
212263
212263
|
var StreamSearch = require_sbmh();
|
|
212264
212264
|
var {
|
|
212265
|
-
basename:
|
|
212265
|
+
basename: basename5,
|
|
212266
212266
|
convertToUTF8,
|
|
212267
212267
|
getDecoder,
|
|
212268
212268
|
parseContentType,
|
|
@@ -212524,7 +212524,7 @@ var require_multipart = __commonJS((exports, module) => {
|
|
|
212524
212524
|
else if (disp.params.filename)
|
|
212525
212525
|
filename = disp.params.filename;
|
|
212526
212526
|
if (filename !== undefined && !preservePath)
|
|
212527
|
-
filename =
|
|
212527
|
+
filename = basename5(filename);
|
|
212528
212528
|
}
|
|
212529
212529
|
if (header2["content-type"]) {
|
|
212530
212530
|
const conType = parseContentType(header2["content-type"][0]);
|
|
@@ -215914,14 +215914,14 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
215914
215914
|
};
|
|
215915
215915
|
}
|
|
215916
215916
|
function readAndResolve(iter) {
|
|
215917
|
-
var
|
|
215918
|
-
if (
|
|
215917
|
+
var resolve10 = iter[kLastResolve];
|
|
215918
|
+
if (resolve10 !== null) {
|
|
215919
215919
|
var data = iter[kStream].read();
|
|
215920
215920
|
if (data !== null) {
|
|
215921
215921
|
iter[kLastPromise] = null;
|
|
215922
215922
|
iter[kLastResolve] = null;
|
|
215923
215923
|
iter[kLastReject] = null;
|
|
215924
|
-
|
|
215924
|
+
resolve10(createIterResult(data, false));
|
|
215925
215925
|
}
|
|
215926
215926
|
}
|
|
215927
215927
|
}
|
|
@@ -215929,13 +215929,13 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
215929
215929
|
process.nextTick(readAndResolve, iter);
|
|
215930
215930
|
}
|
|
215931
215931
|
function wrapForNext(lastPromise, iter) {
|
|
215932
|
-
return function(
|
|
215932
|
+
return function(resolve10, reject) {
|
|
215933
215933
|
lastPromise.then(function() {
|
|
215934
215934
|
if (iter[kEnded]) {
|
|
215935
|
-
|
|
215935
|
+
resolve10(createIterResult(undefined, true));
|
|
215936
215936
|
return;
|
|
215937
215937
|
}
|
|
215938
|
-
iter[kHandlePromise](
|
|
215938
|
+
iter[kHandlePromise](resolve10, reject);
|
|
215939
215939
|
}, reject);
|
|
215940
215940
|
};
|
|
215941
215941
|
}
|
|
@@ -215954,12 +215954,12 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
215954
215954
|
return Promise.resolve(createIterResult(undefined, true));
|
|
215955
215955
|
}
|
|
215956
215956
|
if (this[kStream].destroyed) {
|
|
215957
|
-
return new Promise(function(
|
|
215957
|
+
return new Promise(function(resolve10, reject) {
|
|
215958
215958
|
process.nextTick(function() {
|
|
215959
215959
|
if (_this[kError]) {
|
|
215960
215960
|
reject(_this[kError]);
|
|
215961
215961
|
} else {
|
|
215962
|
-
|
|
215962
|
+
resolve10(createIterResult(undefined, true));
|
|
215963
215963
|
}
|
|
215964
215964
|
});
|
|
215965
215965
|
});
|
|
@@ -215982,13 +215982,13 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
215982
215982
|
return this;
|
|
215983
215983
|
}), _defineProperty(_Object$setPrototypeO, "return", function _return() {
|
|
215984
215984
|
var _this2 = this;
|
|
215985
|
-
return new Promise(function(
|
|
215985
|
+
return new Promise(function(resolve10, reject) {
|
|
215986
215986
|
_this2[kStream].destroy(null, function(err) {
|
|
215987
215987
|
if (err) {
|
|
215988
215988
|
reject(err);
|
|
215989
215989
|
return;
|
|
215990
215990
|
}
|
|
215991
|
-
|
|
215991
|
+
resolve10(createIterResult(undefined, true));
|
|
215992
215992
|
});
|
|
215993
215993
|
});
|
|
215994
215994
|
}), _Object$setPrototypeO), AsyncIteratorPrototype);
|
|
@@ -216010,15 +216010,15 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
216010
216010
|
value: stream._readableState.endEmitted,
|
|
216011
216011
|
writable: true
|
|
216012
216012
|
}), _defineProperty(_Object$create, kHandlePromise, {
|
|
216013
|
-
value: function value(
|
|
216013
|
+
value: function value(resolve10, reject) {
|
|
216014
216014
|
var data = iterator[kStream].read();
|
|
216015
216015
|
if (data) {
|
|
216016
216016
|
iterator[kLastPromise] = null;
|
|
216017
216017
|
iterator[kLastResolve] = null;
|
|
216018
216018
|
iterator[kLastReject] = null;
|
|
216019
|
-
|
|
216019
|
+
resolve10(createIterResult(data, false));
|
|
216020
216020
|
} else {
|
|
216021
|
-
iterator[kLastResolve] =
|
|
216021
|
+
iterator[kLastResolve] = resolve10;
|
|
216022
216022
|
iterator[kLastReject] = reject;
|
|
216023
216023
|
}
|
|
216024
216024
|
},
|
|
@@ -216037,12 +216037,12 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
216037
216037
|
iterator[kError] = err;
|
|
216038
216038
|
return;
|
|
216039
216039
|
}
|
|
216040
|
-
var
|
|
216041
|
-
if (
|
|
216040
|
+
var resolve10 = iterator[kLastResolve];
|
|
216041
|
+
if (resolve10 !== null) {
|
|
216042
216042
|
iterator[kLastPromise] = null;
|
|
216043
216043
|
iterator[kLastResolve] = null;
|
|
216044
216044
|
iterator[kLastReject] = null;
|
|
216045
|
-
|
|
216045
|
+
resolve10(createIterResult(undefined, true));
|
|
216046
216046
|
}
|
|
216047
216047
|
iterator[kEnded] = true;
|
|
216048
216048
|
});
|
|
@@ -216054,7 +216054,7 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
216054
216054
|
|
|
216055
216055
|
// ../../node_modules/readable-stream/lib/internal/streams/from.js
|
|
216056
216056
|
var require_from = __commonJS((exports, module) => {
|
|
216057
|
-
function asyncGeneratorStep(gen,
|
|
216057
|
+
function asyncGeneratorStep(gen, resolve10, reject, _next, _throw, key2, arg) {
|
|
216058
216058
|
try {
|
|
216059
216059
|
var info = gen[key2](arg);
|
|
216060
216060
|
var value = info.value;
|
|
@@ -216063,7 +216063,7 @@ var require_from = __commonJS((exports, module) => {
|
|
|
216063
216063
|
return;
|
|
216064
216064
|
}
|
|
216065
216065
|
if (info.done) {
|
|
216066
|
-
|
|
216066
|
+
resolve10(value);
|
|
216067
216067
|
} else {
|
|
216068
216068
|
Promise.resolve(value).then(_next, _throw);
|
|
216069
216069
|
}
|
|
@@ -216071,13 +216071,13 @@ var require_from = __commonJS((exports, module) => {
|
|
|
216071
216071
|
function _asyncToGenerator(fn9) {
|
|
216072
216072
|
return function() {
|
|
216073
216073
|
var self2 = this, args = arguments;
|
|
216074
|
-
return new Promise(function(
|
|
216074
|
+
return new Promise(function(resolve10, reject) {
|
|
216075
216075
|
var gen = fn9.apply(self2, args);
|
|
216076
216076
|
function _next(value) {
|
|
216077
|
-
asyncGeneratorStep(gen,
|
|
216077
|
+
asyncGeneratorStep(gen, resolve10, reject, _next, _throw, "next", value);
|
|
216078
216078
|
}
|
|
216079
216079
|
function _throw(err) {
|
|
216080
|
-
asyncGeneratorStep(gen,
|
|
216080
|
+
asyncGeneratorStep(gen, resolve10, reject, _next, _throw, "throw", err);
|
|
216081
216081
|
}
|
|
216082
216082
|
_next(undefined);
|
|
216083
216083
|
});
|
|
@@ -218205,7 +218205,7 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
218205
218205
|
});
|
|
218206
218206
|
module.exports = __toCommonJS(src_exports);
|
|
218207
218207
|
var import_promises22 = __require("node:fs/promises");
|
|
218208
|
-
var
|
|
218208
|
+
var import_node_fs24 = __require("node:fs");
|
|
218209
218209
|
var DEVIN_LOCAL_PATH = "/opt/.devin";
|
|
218210
218210
|
var CURSOR2 = "cursor";
|
|
218211
218211
|
var CURSOR_CLI = "cursor-cli";
|
|
@@ -218262,7 +218262,7 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
218262
218262
|
return { isAgent: true, agent: { name: REPLIT } };
|
|
218263
218263
|
}
|
|
218264
218264
|
try {
|
|
218265
|
-
await (0, import_promises22.access)(DEVIN_LOCAL_PATH,
|
|
218265
|
+
await (0, import_promises22.access)(DEVIN_LOCAL_PATH, import_node_fs24.constants.F_OK);
|
|
218266
218266
|
return { isAgent: true, agent: { name: DEVIN } };
|
|
218267
218267
|
} catch (error48) {}
|
|
218268
218268
|
return { isAgent: false, agent: undefined };
|
|
@@ -218271,7 +218271,24 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
218271
218271
|
|
|
218272
218272
|
// src/core/utils/env.ts
|
|
218273
218273
|
var import_dotenv = __toESM(require_main(), 1);
|
|
218274
|
-
import {
|
|
218274
|
+
import { existsSync } from "node:fs";
|
|
218275
|
+
import { dirname as dirname2, join } from "node:path";
|
|
218276
|
+
|
|
218277
|
+
// src/core/consts.ts
|
|
218278
|
+
var PROJECT_SUBDIR = "base44";
|
|
218279
|
+
var CONFIG_FILE_EXTENSION = "jsonc";
|
|
218280
|
+
var CONFIG_FILE_EXTENSION_GLOB = "{json,jsonc}";
|
|
218281
|
+
var FUNCTION_CONFIG_GLOB = `**/function.${CONFIG_FILE_EXTENSION_GLOB}`;
|
|
218282
|
+
var ENTRY_FILE_GLOB = "**/entry.{js,ts}";
|
|
218283
|
+
var ENTRY_IGNORE_DOT_PATHS = ["**/*.*/**"];
|
|
218284
|
+
var APP_CONFIG_PATTERN = `**/.app.${CONFIG_FILE_EXTENSION_GLOB}`;
|
|
218285
|
+
var PROJECT_CONFIG_PATTERNS = [
|
|
218286
|
+
`${PROJECT_SUBDIR}/config.${CONFIG_FILE_EXTENSION_GLOB}`,
|
|
218287
|
+
`config.${CONFIG_FILE_EXTENSION_GLOB}`
|
|
218288
|
+
];
|
|
218289
|
+
var TYPES_OUTPUT_SUBDIR = ".types";
|
|
218290
|
+
var TYPES_FILENAME = "types.d.ts";
|
|
218291
|
+
var AUTH_CLIENT_ID = "base44_cli";
|
|
218275
218292
|
|
|
218276
218293
|
// src/core/utils/fs.ts
|
|
218277
218294
|
var import_json5 = __toESM(require_lib(), 1);
|
|
@@ -233041,9 +233058,21 @@ var BASE44_ENV_KEYS = [
|
|
|
233041
233058
|
"BASE44_REFRESH_TOKEN",
|
|
233042
233059
|
"BASE44_API_URL"
|
|
233043
233060
|
];
|
|
233061
|
+
var PROJECT_CONFIG_FILES = ["jsonc", "json"].map((ext) => join(PROJECT_SUBDIR, `config.${ext}`));
|
|
233062
|
+
function findProjectRootSync(startDir) {
|
|
233063
|
+
let current = startDir;
|
|
233064
|
+
while (current !== dirname2(current)) {
|
|
233065
|
+
if (PROJECT_CONFIG_FILES.some((rel) => existsSync(join(current, rel)))) {
|
|
233066
|
+
return current;
|
|
233067
|
+
}
|
|
233068
|
+
current = dirname2(current);
|
|
233069
|
+
}
|
|
233070
|
+
return null;
|
|
233071
|
+
}
|
|
233044
233072
|
function loadProjectEnvFiles(cwd = process.cwd()) {
|
|
233073
|
+
const root = findProjectRootSync(cwd) ?? cwd;
|
|
233045
233074
|
import_dotenv.config({
|
|
233046
|
-
path: [join(
|
|
233075
|
+
path: [join(root, ".env.local"), join(root, ".env")],
|
|
233047
233076
|
quiet: true
|
|
233048
233077
|
});
|
|
233049
233078
|
normalizeBase44Env();
|
|
@@ -233064,7 +233093,7 @@ function normalizeBase44Env() {
|
|
|
233064
233093
|
loadProjectEnvFiles();
|
|
233065
233094
|
|
|
233066
233095
|
// src/cli/index.ts
|
|
233067
|
-
import { dirname as
|
|
233096
|
+
import { dirname as dirname22, join as join29 } from "node:path";
|
|
233068
233097
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
233069
233098
|
|
|
233070
233099
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -234272,7 +234301,7 @@ var {
|
|
|
234272
234301
|
} = import__.default;
|
|
234273
234302
|
|
|
234274
234303
|
// src/cli/commands/agents/pull.ts
|
|
234275
|
-
import { dirname as
|
|
234304
|
+
import { dirname as dirname9, join as join14 } from "node:path";
|
|
234276
234305
|
// ../../node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
234277
234306
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
234278
234307
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
@@ -235036,22 +235065,6 @@ var import_jsonwebtoken = __toESM(require_jsonwebtoken(), 1);
|
|
|
235036
235065
|
import { homedir } from "node:os";
|
|
235037
235066
|
import { join as join2 } from "node:path";
|
|
235038
235067
|
|
|
235039
|
-
// src/core/consts.ts
|
|
235040
|
-
var PROJECT_SUBDIR = "base44";
|
|
235041
|
-
var CONFIG_FILE_EXTENSION = "jsonc";
|
|
235042
|
-
var CONFIG_FILE_EXTENSION_GLOB = "{json,jsonc}";
|
|
235043
|
-
var FUNCTION_CONFIG_GLOB = `**/function.${CONFIG_FILE_EXTENSION_GLOB}`;
|
|
235044
|
-
var ENTRY_FILE_GLOB = "**/entry.{js,ts}";
|
|
235045
|
-
var ENTRY_IGNORE_DOT_PATHS = ["**/*.*/**"];
|
|
235046
|
-
var APP_CONFIG_PATTERN = `**/.app.${CONFIG_FILE_EXTENSION_GLOB}`;
|
|
235047
|
-
var PROJECT_CONFIG_PATTERNS = [
|
|
235048
|
-
`${PROJECT_SUBDIR}/config.${CONFIG_FILE_EXTENSION_GLOB}`,
|
|
235049
|
-
`config.${CONFIG_FILE_EXTENSION_GLOB}`
|
|
235050
|
-
];
|
|
235051
|
-
var TYPES_OUTPUT_SUBDIR = ".types";
|
|
235052
|
-
var TYPES_FILENAME = "types.d.ts";
|
|
235053
|
-
var AUTH_CLIENT_ID = "base44_cli";
|
|
235054
|
-
|
|
235055
235068
|
// src/core/project/schema.ts
|
|
235056
235069
|
var TemplateSchema = exports_external.object({
|
|
235057
235070
|
id: exports_external.string(),
|
|
@@ -236292,7 +236305,7 @@ import path3 from "node:path";
|
|
|
236292
236305
|
|
|
236293
236306
|
// ../../node_modules/tar/dist/esm/list.js
|
|
236294
236307
|
import fs2 from "node:fs";
|
|
236295
|
-
import { dirname as
|
|
236308
|
+
import { dirname as dirname3, parse as parse7 } from "path";
|
|
236296
236309
|
|
|
236297
236310
|
// ../../node_modules/tar/dist/esm/options.js
|
|
236298
236311
|
var argmap = new Map([
|
|
@@ -237868,7 +237881,7 @@ var filesFilter = (opt, files) => {
|
|
|
237868
237881
|
if (m !== undefined) {
|
|
237869
237882
|
ret = m;
|
|
237870
237883
|
} else {
|
|
237871
|
-
ret = mapHas(
|
|
237884
|
+
ret = mapHas(dirname3(file2), root);
|
|
237872
237885
|
}
|
|
237873
237886
|
}
|
|
237874
237887
|
map2.set(file2, ret);
|
|
@@ -241392,9 +241405,9 @@ var shouldExpandGlobstarDirectory = (pattern) => {
|
|
|
241392
241405
|
if (!match) {
|
|
241393
241406
|
return false;
|
|
241394
241407
|
}
|
|
241395
|
-
const
|
|
241396
|
-
const hasWildcards = /[*?[\]{}]/.test(
|
|
241397
|
-
const hasExtension = nodePath.extname(
|
|
241408
|
+
const dirname4 = match[1];
|
|
241409
|
+
const hasWildcards = /[*?[\]{}]/.test(dirname4);
|
|
241410
|
+
const hasExtension = nodePath.extname(dirname4) && !dirname4.startsWith(".");
|
|
241398
241411
|
return !hasWildcards && !hasExtension;
|
|
241399
241412
|
};
|
|
241400
241413
|
var getDirectoryGlob = ({ directoryPath, files, extensions }) => {
|
|
@@ -241651,17 +241664,17 @@ var generateGlobTasks = normalizeArguments(generateTasks);
|
|
|
241651
241664
|
var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
|
|
241652
241665
|
|
|
241653
241666
|
// src/core/project/config.ts
|
|
241654
|
-
import { dirname as
|
|
241667
|
+
import { dirname as dirname7, join as join10 } from "node:path";
|
|
241655
241668
|
|
|
241656
241669
|
// src/core/project/plugins.ts
|
|
241657
241670
|
import { createRequire as createRequire2 } from "node:module";
|
|
241658
|
-
import { dirname as
|
|
241671
|
+
import { dirname as dirname4, isAbsolute as isAbsolute2, join as join4, resolve } from "node:path";
|
|
241659
241672
|
function resolvePluginRoot(pluginSource, fromRoot) {
|
|
241660
241673
|
if (pluginSource.startsWith(".") || isAbsolute2(pluginSource)) {
|
|
241661
241674
|
return resolve(fromRoot, pluginSource);
|
|
241662
241675
|
}
|
|
241663
241676
|
const req = createRequire2(join4(fromRoot, "package.json"));
|
|
241664
|
-
return
|
|
241677
|
+
return dirname4(req.resolve(`${pluginSource}/package.json`));
|
|
241665
241678
|
}
|
|
241666
241679
|
function requirePluginNamespace(project, pluginSource, configPath) {
|
|
241667
241680
|
if (!project.plugin?.namespace) {
|
|
@@ -243282,7 +243295,7 @@ async function fetchFunctionLogs(functionName, filters = {}) {
|
|
|
243282
243295
|
return result.data;
|
|
243283
243296
|
}
|
|
243284
243297
|
// src/core/resources/function/config.ts
|
|
243285
|
-
import { basename as basename2, dirname as
|
|
243298
|
+
import { basename as basename2, dirname as dirname5, join as join8, relative } from "node:path";
|
|
243286
243299
|
async function readFunctionConfig(configPath) {
|
|
243287
243300
|
const parsed = await readJsonFile(configPath);
|
|
243288
243301
|
const result = FunctionConfigSchema.safeParse(parsed);
|
|
@@ -243293,7 +243306,7 @@ async function readFunctionConfig(configPath) {
|
|
|
243293
243306
|
}
|
|
243294
243307
|
async function readFunction(configPath) {
|
|
243295
243308
|
const config7 = await readFunctionConfig(configPath);
|
|
243296
|
-
const functionDir =
|
|
243309
|
+
const functionDir = dirname5(configPath);
|
|
243297
243310
|
const entryPath = join8(functionDir, config7.entry);
|
|
243298
243311
|
if (!await pathExists(entryPath)) {
|
|
243299
243312
|
throw new InvalidInputError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`, {
|
|
@@ -243325,11 +243338,11 @@ async function readAllFunctions(functionsDir) {
|
|
|
243325
243338
|
absolute: true,
|
|
243326
243339
|
ignore: ENTRY_IGNORE_DOT_PATHS
|
|
243327
243340
|
});
|
|
243328
|
-
const configFilesDirs = new Set(configFiles.map((f) =>
|
|
243329
|
-
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(
|
|
243341
|
+
const configFilesDirs = new Set(configFiles.map((f) => dirname5(f)));
|
|
243342
|
+
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(dirname5(entryFile)));
|
|
243330
243343
|
const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
|
|
243331
243344
|
const functionsWithoutConfig = await Promise.all(entryFilesWithoutConfig.map(async (entryFile) => {
|
|
243332
|
-
const functionDir =
|
|
243345
|
+
const functionDir = dirname5(entryFile);
|
|
243333
243346
|
const filePaths = await globby("**/*.{js,ts,json}", {
|
|
243334
243347
|
cwd: functionDir,
|
|
243335
243348
|
absolute: true
|
|
@@ -243371,9 +243384,9 @@ async function readAllFunctions(functionsDir) {
|
|
|
243371
243384
|
return functions;
|
|
243372
243385
|
}
|
|
243373
243386
|
// src/core/resources/function/deploy.ts
|
|
243374
|
-
import { dirname as
|
|
243387
|
+
import { dirname as dirname6, relative as relative2 } from "node:path";
|
|
243375
243388
|
async function loadFunctionCode(fn) {
|
|
243376
|
-
const functionDir =
|
|
243389
|
+
const functionDir = dirname6(fn.entryPath);
|
|
243377
243390
|
const resolvedFiles = await Promise.all(fn.filePaths.map(async (filePath) => {
|
|
243378
243391
|
const content = await readTextFile(filePath);
|
|
243379
243392
|
const path11 = relative2(functionDir, filePath).split(/[/\\]/).join("/");
|
|
@@ -243514,12 +243527,12 @@ async function findConfigInDir(dir) {
|
|
|
243514
243527
|
}
|
|
243515
243528
|
async function findProjectRoot(startPath) {
|
|
243516
243529
|
let current = startPath || process.cwd();
|
|
243517
|
-
while (current !==
|
|
243530
|
+
while (current !== dirname7(current)) {
|
|
243518
243531
|
const configPath = await findConfigInDir(current);
|
|
243519
243532
|
if (configPath) {
|
|
243520
243533
|
return { root: current, configPath };
|
|
243521
243534
|
}
|
|
243522
|
-
current =
|
|
243535
|
+
current = dirname7(current);
|
|
243523
243536
|
}
|
|
243524
243537
|
return null;
|
|
243525
243538
|
}
|
|
@@ -243569,7 +243582,7 @@ class ProjectConfigReader {
|
|
|
243569
243582
|
return result.data;
|
|
243570
243583
|
}
|
|
243571
243584
|
async readProjectResources(configPath, project) {
|
|
243572
|
-
const configDir =
|
|
243585
|
+
const configDir = dirname7(configPath);
|
|
243573
243586
|
const [entities, functions, agents, connectors, authConfig] = await Promise.all([
|
|
243574
243587
|
entityResource.readAll(join10(configDir, project.entitiesDir)),
|
|
243575
243588
|
functionResource.readAll(join10(configDir, project.functionsDir)),
|
|
@@ -243598,7 +243611,7 @@ class ProjectConfigReader {
|
|
|
243598
243611
|
this.pluginSourceByNamespace.set(namespace, source);
|
|
243599
243612
|
}
|
|
243600
243613
|
async readPluginConfig(plugin, hostConfigPath) {
|
|
243601
|
-
const pluginRoot = resolvePluginRoot(plugin.source,
|
|
243614
|
+
const pluginRoot = resolvePluginRoot(plugin.source, dirname7(hostConfigPath));
|
|
243602
243615
|
const { configPath } = await this.findConfigOrThrow(pluginRoot);
|
|
243603
243616
|
const project = await this.readConfigFile(configPath);
|
|
243604
243617
|
const namespace = requirePluginNamespace(project, plugin.source, configPath);
|
|
@@ -243848,10 +243861,10 @@ async function getSiteUrl(projectId) {
|
|
|
243848
243861
|
// src/core/project/template.ts
|
|
243849
243862
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
243850
243863
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
243851
|
-
import { dirname as
|
|
243864
|
+
import { dirname as dirname8, join as join12 } from "node:path";
|
|
243852
243865
|
|
|
243853
243866
|
// src/core/assets.ts
|
|
243854
|
-
import { cpSync, existsSync } from "node:fs";
|
|
243867
|
+
import { cpSync, existsSync as existsSync2 } from "node:fs";
|
|
243855
243868
|
import { homedir as homedir2 } from "node:os";
|
|
243856
243869
|
import { join as join11 } from "node:path";
|
|
243857
243870
|
// package.json
|
|
@@ -243966,9 +243979,9 @@ function getExecWrapperPath() {
|
|
|
243966
243979
|
return join11(ASSETS_DIR, "deno-runtime", "exec.ts");
|
|
243967
243980
|
}
|
|
243968
243981
|
function ensureNpmAssets(sourceDir) {
|
|
243969
|
-
if (
|
|
243982
|
+
if (existsSync2(ASSETS_DIR))
|
|
243970
243983
|
return;
|
|
243971
|
-
if (!
|
|
243984
|
+
if (!existsSync2(sourceDir))
|
|
243972
243985
|
return;
|
|
243973
243986
|
cpSync(sourceDir, ASSETS_DIR, { recursive: true });
|
|
243974
243987
|
}
|
|
@@ -243983,24 +243996,34 @@ async function listTemplates() {
|
|
|
243983
243996
|
}
|
|
243984
243997
|
return result.data.templates;
|
|
243985
243998
|
}
|
|
243986
|
-
async function renderTemplate(template, destPath, data) {
|
|
243999
|
+
async function renderTemplate(template, destPath, data, options = {}) {
|
|
244000
|
+
const { skipExisting = false } = options;
|
|
243987
244001
|
const templateDir = join12(getTemplatesDir(), template.path);
|
|
243988
244002
|
const files = await globby("**/*", {
|
|
243989
244003
|
cwd: templateDir,
|
|
243990
244004
|
dot: true,
|
|
243991
244005
|
onlyFiles: true
|
|
243992
244006
|
});
|
|
244007
|
+
const skipped = [];
|
|
243993
244008
|
for (const file2 of files) {
|
|
243994
244009
|
const srcPath = join12(templateDir, file2);
|
|
243995
244010
|
try {
|
|
243996
244011
|
if (file2.endsWith(".ejs")) {
|
|
243997
244012
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
243998
244013
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
243999
|
-
const destFile = attributes.outputFileName ? join12(
|
|
244014
|
+
const destFile = attributes.outputFileName ? join12(dirname8(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
244000
244015
|
const destFilePath = join12(destPath, destFile);
|
|
244016
|
+
if (skipExisting && await pathExists(destFilePath)) {
|
|
244017
|
+
skipped.push(destFile);
|
|
244018
|
+
continue;
|
|
244019
|
+
}
|
|
244001
244020
|
await writeFile(destFilePath, body);
|
|
244002
244021
|
} else {
|
|
244003
244022
|
const destFilePath = join12(destPath, file2);
|
|
244023
|
+
if (skipExisting && await pathExists(destFilePath)) {
|
|
244024
|
+
skipped.push(file2);
|
|
244025
|
+
continue;
|
|
244026
|
+
}
|
|
244004
244027
|
await copyFile(srcPath, destFilePath);
|
|
244005
244028
|
}
|
|
244006
244029
|
} catch (error48) {
|
|
@@ -244008,6 +244031,7 @@ async function renderTemplate(template, destPath, data) {
|
|
|
244008
244031
|
throw new Error(`Failed to process template file "${file2}": ${message}`);
|
|
244009
244032
|
}
|
|
244010
244033
|
}
|
|
244034
|
+
return skipped;
|
|
244011
244035
|
}
|
|
244012
244036
|
|
|
244013
244037
|
// src/core/project/create.ts
|
|
@@ -244030,6 +244054,20 @@ async function createProjectFiles(options) {
|
|
|
244030
244054
|
projectDir: basePath
|
|
244031
244055
|
};
|
|
244032
244056
|
}
|
|
244057
|
+
async function initProjectFiles(options) {
|
|
244058
|
+
const { name: name2, description, path: basePath, template, appId } = options;
|
|
244059
|
+
await assertProjectNotExists(basePath);
|
|
244060
|
+
const skippedFiles = await renderTemplate(template, basePath, {
|
|
244061
|
+
name: name2,
|
|
244062
|
+
description,
|
|
244063
|
+
projectId: appId
|
|
244064
|
+
}, { skipExisting: true });
|
|
244065
|
+
return {
|
|
244066
|
+
projectId: appId,
|
|
244067
|
+
projectDir: basePath,
|
|
244068
|
+
skippedFiles
|
|
244069
|
+
};
|
|
244070
|
+
}
|
|
244033
244071
|
async function createProjectFilesForExistingProject(options) {
|
|
244034
244072
|
const { projectId, projectPath } = options;
|
|
244035
244073
|
await assertProjectNotExists(projectPath);
|
|
@@ -251274,7 +251312,7 @@ async function pullAgentsAction({
|
|
|
251274
251312
|
runTask: runTask2
|
|
251275
251313
|
}) {
|
|
251276
251314
|
const { project: project2 } = await readProjectConfig();
|
|
251277
|
-
const configDir =
|
|
251315
|
+
const configDir = dirname9(project2.configPath);
|
|
251278
251316
|
const agentsDir = join14(configDir, project2.agentsDir);
|
|
251279
251317
|
const remoteAgents = await runTask2("Fetching agents from Base44", async () => {
|
|
251280
251318
|
return await fetchAgents();
|
|
@@ -251339,11 +251377,11 @@ function getAgentsCommand() {
|
|
|
251339
251377
|
}
|
|
251340
251378
|
|
|
251341
251379
|
// src/cli/commands/auth/password-login.ts
|
|
251342
|
-
import { dirname as
|
|
251380
|
+
import { dirname as dirname10, join as join15 } from "node:path";
|
|
251343
251381
|
async function passwordLoginAction({ log, runTask: runTask2 }, action) {
|
|
251344
251382
|
const shouldEnable = action === "enable";
|
|
251345
251383
|
const { project: project2 } = await readProjectConfig();
|
|
251346
|
-
const configDir =
|
|
251384
|
+
const configDir = dirname10(project2.configPath);
|
|
251347
251385
|
const authDir = join15(configDir, project2.authDir);
|
|
251348
251386
|
const updated = await runTask2("Updating local auth config", async () => {
|
|
251349
251387
|
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
@@ -251364,13 +251402,13 @@ function getPasswordLoginCommand() {
|
|
|
251364
251402
|
}
|
|
251365
251403
|
|
|
251366
251404
|
// src/cli/commands/auth/pull.ts
|
|
251367
|
-
import { dirname as
|
|
251405
|
+
import { dirname as dirname11, join as join16 } from "node:path";
|
|
251368
251406
|
async function pullAuthAction({
|
|
251369
251407
|
log,
|
|
251370
251408
|
runTask: runTask2
|
|
251371
251409
|
}) {
|
|
251372
251410
|
const { project: project2 } = await readProjectConfig();
|
|
251373
|
-
const configDir =
|
|
251411
|
+
const configDir = dirname11(project2.configPath);
|
|
251374
251412
|
const authDir = join16(configDir, project2.authDir);
|
|
251375
251413
|
const remoteConfig = await runTask2("Fetching auth config from Base44", async () => {
|
|
251376
251414
|
return await pullAuthConfig();
|
|
@@ -251435,7 +251473,7 @@ function getAuthPushCommand() {
|
|
|
251435
251473
|
}
|
|
251436
251474
|
|
|
251437
251475
|
// src/cli/commands/auth/social-login.ts
|
|
251438
|
-
import { dirname as
|
|
251476
|
+
import { dirname as dirname12, join as join17, resolve as resolve3 } from "node:path";
|
|
251439
251477
|
var PROVIDER_LABELS = {
|
|
251440
251478
|
google: "Google",
|
|
251441
251479
|
microsoft: "Microsoft",
|
|
@@ -251505,7 +251543,7 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
|
|
|
251505
251543
|
}
|
|
251506
251544
|
}
|
|
251507
251545
|
const { project: project2 } = await readProjectConfig();
|
|
251508
|
-
const configDir =
|
|
251546
|
+
const configDir = dirname12(project2.configPath);
|
|
251509
251547
|
const authDir = join17(configDir, project2.authDir);
|
|
251510
251548
|
const { config: updated } = await runTask2("Updating local auth config", async () => updateSocialLoginConfig(authDir, provider, shouldEnable, useCustomOAuth && options.clientId ? { clientId: options.clientId } : undefined));
|
|
251511
251549
|
if (clientSecret) {
|
|
@@ -251531,7 +251569,7 @@ function getSocialLoginCommand() {
|
|
|
251531
251569
|
}
|
|
251532
251570
|
|
|
251533
251571
|
// src/cli/commands/auth/sso.ts
|
|
251534
|
-
import { dirname as
|
|
251572
|
+
import { dirname as dirname13, join as join18, resolve as resolve4 } from "node:path";
|
|
251535
251573
|
var SSOConfigFileSchema = exports_external.object({
|
|
251536
251574
|
provider: exports_external.enum(Object.values(KNOWN_SSO_PROVIDERS)),
|
|
251537
251575
|
clientId: exports_external.string(),
|
|
@@ -251694,7 +251732,7 @@ async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options)
|
|
|
251694
251732
|
throw error48;
|
|
251695
251733
|
}
|
|
251696
251734
|
const { project: project2 } = await readProjectConfig();
|
|
251697
|
-
const configDir =
|
|
251735
|
+
const configDir = dirname13(project2.configPath);
|
|
251698
251736
|
const authDir = join18(configDir, project2.authDir);
|
|
251699
251737
|
await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
|
|
251700
251738
|
await runTask2("Saving SSO credentials", async () => pushSSOSecrets(secrets));
|
|
@@ -251710,7 +251748,7 @@ async function ssoDisableAction({ log, runTask: runTask2 }, options) {
|
|
|
251710
251748
|
throw new InvalidInputError("Configuration options cannot be used with disable. To disable SSO: base44 auth sso disable");
|
|
251711
251749
|
}
|
|
251712
251750
|
const { project: project2 } = await readProjectConfig();
|
|
251713
|
-
const configDir =
|
|
251751
|
+
const configDir = dirname13(project2.configPath);
|
|
251714
251752
|
const authDir = join18(configDir, project2.authDir);
|
|
251715
251753
|
const updated = await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
|
|
251716
251754
|
await runTask2("Removing SSO credentials", async () => deleteSSOSecrets());
|
|
@@ -251798,13 +251836,13 @@ function getConnectorsListAvailableCommand() {
|
|
|
251798
251836
|
}
|
|
251799
251837
|
|
|
251800
251838
|
// src/cli/commands/connectors/pull.ts
|
|
251801
|
-
import { dirname as
|
|
251839
|
+
import { dirname as dirname14, join as join19 } from "node:path";
|
|
251802
251840
|
async function pullConnectorsAction({
|
|
251803
251841
|
log,
|
|
251804
251842
|
runTask: runTask2
|
|
251805
251843
|
}) {
|
|
251806
251844
|
const { project: project2 } = await readProjectConfig();
|
|
251807
|
-
const configDir =
|
|
251845
|
+
const configDir = dirname14(project2.configPath);
|
|
251808
251846
|
const connectorsDir = join19(configDir, project2.connectorsDir);
|
|
251809
251847
|
const remoteConnectors = await runTask2("Fetching connectors from Base44", async () => {
|
|
251810
251848
|
return await pullAllConnectors();
|
|
@@ -252865,10 +252903,10 @@ function getListCommand() {
|
|
|
252865
252903
|
}
|
|
252866
252904
|
|
|
252867
252905
|
// src/cli/commands/functions/pull.ts
|
|
252868
|
-
import { dirname as
|
|
252906
|
+
import { dirname as dirname15, join as join20 } from "node:path";
|
|
252869
252907
|
async function pullFunctionsAction({ log, runTask: runTask2 }, name2) {
|
|
252870
252908
|
const { project: project2, functions } = await readProjectConfig();
|
|
252871
|
-
const configDir =
|
|
252909
|
+
const configDir = dirname15(project2.configPath);
|
|
252872
252910
|
const functionsDir = join20(configDir, project2.functionsDir);
|
|
252873
252911
|
const pluginFunctionNames = new Set(functions.filter((fn) => fn.source.type === "plugin").map((fn) => fn.name));
|
|
252874
252912
|
const remoteFunctions = await runTask2("Fetching functions from Base44", async () => {
|
|
@@ -253097,7 +253135,8 @@ async function executeCreate({
|
|
|
253097
253135
|
deploy: deploy5,
|
|
253098
253136
|
skills,
|
|
253099
253137
|
isInteractive
|
|
253100
|
-
},
|
|
253138
|
+
}, ctx) {
|
|
253139
|
+
const { log, runTask: runTask2 } = ctx;
|
|
253101
253140
|
const name2 = rawName.trim();
|
|
253102
253141
|
const resolvedPath = resolve5(projectPath);
|
|
253103
253142
|
const { projectId } = await runTask2("Setting up your project...", async () => {
|
|
@@ -253112,16 +253151,16 @@ async function executeCreate({
|
|
|
253112
253151
|
errorMessage: "Failed to create project"
|
|
253113
253152
|
});
|
|
253114
253153
|
setAppConfig({ id: projectId, projectRoot: resolvedPath });
|
|
253115
|
-
const summary = await completeProjectSetup({ projectId, name: name2, resolvedPath, deploy: deploy5, skills, isInteractive },
|
|
253154
|
+
const summary = await completeProjectSetup({ projectId, name: name2, resolvedPath, deploy: deploy5, skills, isInteractive }, ctx);
|
|
253116
253155
|
printProjectSummary(summary, log);
|
|
253117
253156
|
return { outroMessage: "Your project is set up and ready to use" };
|
|
253118
253157
|
}
|
|
253119
|
-
async function createAction(
|
|
253158
|
+
async function createAction(ctx, name2, options) {
|
|
253120
253159
|
if (name2 && !options.path) {
|
|
253121
253160
|
options.path = `./${import_kebabCase.default(name2)}`;
|
|
253122
253161
|
}
|
|
253123
253162
|
const skipPrompts = !!(options.name ?? name2) && !!options.path;
|
|
253124
|
-
if (!skipPrompts && isNonInteractive) {
|
|
253163
|
+
if (!skipPrompts && ctx.isNonInteractive) {
|
|
253125
253164
|
throw new InvalidInputError("Project name and --path are required in non-interactive mode", {
|
|
253126
253165
|
hints: [
|
|
253127
253166
|
{
|
|
@@ -253130,7 +253169,6 @@ async function createAction({ log, runTask: runTask2, isNonInteractive }, name2,
|
|
|
253130
253169
|
]
|
|
253131
253170
|
});
|
|
253132
253171
|
}
|
|
253133
|
-
const ctx = { log, runTask: runTask2 };
|
|
253134
253172
|
if (skipPrompts) {
|
|
253135
253173
|
return await createNonInteractive({ name: options.name ?? name2, ...options }, ctx);
|
|
253136
253174
|
}
|
|
@@ -253509,6 +253547,57 @@ function getLogsCommand() {
|
|
|
253509
253547
|
return new Base44Command("logs").description("Fetch function logs for this app").option("--function <names>", "Filter by function name(s), comma-separated. If omitted, fetches logs for all project functions").option("--since <datetime>", "Show logs from this time (ISO format)", normalizeDatetime).option("--until <datetime>", "Show logs until this time (ISO format)", normalizeDatetime).addOption(new Option("--level <level>", "Filter by log level").choices([...LogLevelSchema.options]).hideHelp()).option("-n, --limit <n>", "Results per page (1-1000, default: 50)").addOption(new Option("--order <order>", "Sort order").choices(["asc", "desc"])).action(logsAction);
|
|
253510
253548
|
}
|
|
253511
253549
|
|
|
253550
|
+
// src/cli/commands/project/scaffold.ts
|
|
253551
|
+
import { basename as basename4, resolve as resolve6 } from "node:path";
|
|
253552
|
+
function resolveAppId(options) {
|
|
253553
|
+
const appId = options.appId ?? process.env.BASE44_APP_ID;
|
|
253554
|
+
if (!appId) {
|
|
253555
|
+
throw new InvalidInputError("No app ID found. `base44 scaffold` sets up a local project for an existing Base44 app.", {
|
|
253556
|
+
hints: [{ message: "Pass it explicitly with --app-id <id>" }]
|
|
253557
|
+
});
|
|
253558
|
+
}
|
|
253559
|
+
return appId;
|
|
253560
|
+
}
|
|
253561
|
+
async function scaffoldAction(ctx, name2, options) {
|
|
253562
|
+
const { log, runTask: runTask2 } = ctx;
|
|
253563
|
+
const appId = resolveAppId(options);
|
|
253564
|
+
const resolvedPath = resolve6("./");
|
|
253565
|
+
const projectName = (name2 ?? basename4(resolvedPath)).trim();
|
|
253566
|
+
const template2 = await getTemplateById("backend-only");
|
|
253567
|
+
log.info(`Scaffolding project at ${resolvedPath}`);
|
|
253568
|
+
const { projectId } = await runTask2("Setting up your project...", async () => {
|
|
253569
|
+
return await initProjectFiles({
|
|
253570
|
+
name: projectName,
|
|
253571
|
+
path: resolvedPath,
|
|
253572
|
+
template: template2,
|
|
253573
|
+
appId
|
|
253574
|
+
});
|
|
253575
|
+
}, {
|
|
253576
|
+
successMessage: theme.colors.base44Orange("Project created successfully"),
|
|
253577
|
+
errorMessage: "Failed to create project"
|
|
253578
|
+
});
|
|
253579
|
+
setAppConfig({ id: projectId, projectRoot: resolvedPath });
|
|
253580
|
+
const summary = await completeProjectSetup({
|
|
253581
|
+
projectId,
|
|
253582
|
+
name: projectName,
|
|
253583
|
+
resolvedPath,
|
|
253584
|
+
deploy: false,
|
|
253585
|
+
skills: options.skills,
|
|
253586
|
+
isInteractive: false
|
|
253587
|
+
}, ctx);
|
|
253588
|
+
printProjectSummary(summary, log);
|
|
253589
|
+
return { outroMessage: "Your project is set up and ready to use" };
|
|
253590
|
+
}
|
|
253591
|
+
function getScaffoldCommand() {
|
|
253592
|
+
return new Base44Command("scaffold", {
|
|
253593
|
+
requireAppConfig: false,
|
|
253594
|
+
fullBanner: true
|
|
253595
|
+
}).description("Scaffold a local project for an existing Base44 app").addArgument(new Argument("name", "Project name").argOptional()).option("--app-id <id>", "Existing Base44 app ID").option("--no-skills", "Skip AI agent skills installation").addHelpText("after", `
|
|
253596
|
+
Examples:
|
|
253597
|
+
$ base44 scaffold --app-id app_123 Scaffolds the current dir for the given app
|
|
253598
|
+
$ base44 scaffold my-app --app-id app_123 Scaffolds the current dir, named "my-app"`).action(scaffoldAction);
|
|
253599
|
+
}
|
|
253600
|
+
|
|
253512
253601
|
// src/cli/commands/secrets/delete.ts
|
|
253513
253602
|
async function deleteSecretAction({ runTask: runTask2 }, key) {
|
|
253514
253603
|
await runTask2(`Deleting secret "${key}"`, async () => {
|
|
@@ -253552,7 +253641,7 @@ function getSecretsListCommand() {
|
|
|
253552
253641
|
}
|
|
253553
253642
|
|
|
253554
253643
|
// src/cli/commands/secrets/set.ts
|
|
253555
|
-
import { resolve as
|
|
253644
|
+
import { resolve as resolve7 } from "node:path";
|
|
253556
253645
|
function parseEntries(entries) {
|
|
253557
253646
|
const secrets = {};
|
|
253558
253647
|
for (const entry of entries) {
|
|
@@ -253583,7 +253672,7 @@ async function setSecretsAction({ log, runTask: runTask2 }, entries, options) {
|
|
|
253583
253672
|
validateInput(entries, options);
|
|
253584
253673
|
let secrets;
|
|
253585
253674
|
if (options.envFile) {
|
|
253586
|
-
secrets = await parseEnvFile(
|
|
253675
|
+
secrets = await parseEnvFile(resolve7(options.envFile));
|
|
253587
253676
|
if (Object.keys(secrets).length === 0) {
|
|
253588
253677
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
253589
253678
|
}
|
|
@@ -253612,7 +253701,7 @@ function getSecretsCommand() {
|
|
|
253612
253701
|
}
|
|
253613
253702
|
|
|
253614
253703
|
// src/cli/commands/site/deploy.ts
|
|
253615
|
-
import { resolve as
|
|
253704
|
+
import { resolve as resolve8 } from "node:path";
|
|
253616
253705
|
async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
253617
253706
|
if (isNonInteractive && !options.yes) {
|
|
253618
253707
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
@@ -253627,7 +253716,7 @@ async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
|
253627
253716
|
]
|
|
253628
253717
|
});
|
|
253629
253718
|
}
|
|
253630
|
-
const outputDir =
|
|
253719
|
+
const outputDir = resolve8(project2.root, project2.site.outputDirectory);
|
|
253631
253720
|
if (!options.yes) {
|
|
253632
253721
|
const shouldDeploy = await Re({
|
|
253633
253722
|
message: `Deploy site from ${project2.site.outputDirectory}?`
|
|
@@ -253805,7 +253894,7 @@ import process21 from "node:process";
|
|
|
253805
253894
|
// src/cli/dev/dev-server/main.ts
|
|
253806
253895
|
var import_cors = __toESM(require_lib4(), 1);
|
|
253807
253896
|
var import_express6 = __toESM(require_express(), 1);
|
|
253808
|
-
import { dirname as
|
|
253897
|
+
import { dirname as dirname20, join as join27 } from "node:path";
|
|
253809
253898
|
|
|
253810
253899
|
// ../../node_modules/get-port/index.js
|
|
253811
253900
|
import net from "node:net";
|
|
@@ -253832,14 +253921,14 @@ var getLocalHosts = () => {
|
|
|
253832
253921
|
}
|
|
253833
253922
|
return results;
|
|
253834
253923
|
};
|
|
253835
|
-
var checkAvailablePort = (options8) => new Promise((
|
|
253924
|
+
var checkAvailablePort = (options8) => new Promise((resolve10, reject) => {
|
|
253836
253925
|
const server = net.createServer();
|
|
253837
253926
|
server.unref();
|
|
253838
253927
|
server.on("error", reject);
|
|
253839
253928
|
server.listen(options8, () => {
|
|
253840
253929
|
const { port } = server.address();
|
|
253841
253930
|
server.close(() => {
|
|
253842
|
-
|
|
253931
|
+
resolve10(port);
|
|
253843
253932
|
});
|
|
253844
253933
|
});
|
|
253845
253934
|
});
|
|
@@ -254099,7 +254188,7 @@ class FunctionManager {
|
|
|
254099
254188
|
});
|
|
254100
254189
|
}
|
|
254101
254190
|
waitForReady(name2, runningFunc) {
|
|
254102
|
-
return new Promise((
|
|
254191
|
+
return new Promise((resolve10, reject) => {
|
|
254103
254192
|
runningFunc.process.on("exit", (code2) => {
|
|
254104
254193
|
if (!runningFunc.ready) {
|
|
254105
254194
|
clearTimeout(timeout3);
|
|
@@ -254122,7 +254211,7 @@ class FunctionManager {
|
|
|
254122
254211
|
runningFunc.ready = true;
|
|
254123
254212
|
clearTimeout(timeout3);
|
|
254124
254213
|
runningFunc.process.stdout?.off("data", onData);
|
|
254125
|
-
|
|
254214
|
+
resolve10(runningFunc.port);
|
|
254126
254215
|
}
|
|
254127
254216
|
};
|
|
254128
254217
|
runningFunc.process.stdout?.on("data", onData);
|
|
@@ -255501,10 +255590,10 @@ class ReaddirpStream extends Readable6 {
|
|
|
255501
255590
|
}
|
|
255502
255591
|
async _formatEntry(dirent, path19) {
|
|
255503
255592
|
let entry;
|
|
255504
|
-
const
|
|
255593
|
+
const basename5 = this._isDirent ? dirent.name : dirent;
|
|
255505
255594
|
try {
|
|
255506
|
-
const fullPath = presolve(pjoin(path19,
|
|
255507
|
-
entry = { path: prelative(this._root, fullPath), fullPath, basename:
|
|
255595
|
+
const fullPath = presolve(pjoin(path19, basename5));
|
|
255596
|
+
entry = { path: prelative(this._root, fullPath), fullPath, basename: basename5 };
|
|
255508
255597
|
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
255509
255598
|
} catch (err) {
|
|
255510
255599
|
this._onError(err);
|
|
@@ -256031,9 +256120,9 @@ class NodeFsHandler {
|
|
|
256031
256120
|
_watchWithNodeFs(path19, listener) {
|
|
256032
256121
|
const opts = this.fsw.options;
|
|
256033
256122
|
const directory = sp2.dirname(path19);
|
|
256034
|
-
const
|
|
256123
|
+
const basename6 = sp2.basename(path19);
|
|
256035
256124
|
const parent = this.fsw._getWatchedDir(directory);
|
|
256036
|
-
parent.add(
|
|
256125
|
+
parent.add(basename6);
|
|
256037
256126
|
const absolutePath = sp2.resolve(path19);
|
|
256038
256127
|
const options8 = {
|
|
256039
256128
|
persistent: opts.persistent
|
|
@@ -256043,7 +256132,7 @@ class NodeFsHandler {
|
|
|
256043
256132
|
let closer;
|
|
256044
256133
|
if (opts.usePolling) {
|
|
256045
256134
|
const enableBin = opts.interval !== opts.binaryInterval;
|
|
256046
|
-
options8.interval = enableBin && isBinaryPath(
|
|
256135
|
+
options8.interval = enableBin && isBinaryPath(basename6) ? opts.binaryInterval : opts.interval;
|
|
256047
256136
|
closer = setFsWatchFileListener(path19, absolutePath, options8, {
|
|
256048
256137
|
listener,
|
|
256049
256138
|
rawEmitter: this.fsw._emitRaw
|
|
@@ -256061,11 +256150,11 @@ class NodeFsHandler {
|
|
|
256061
256150
|
if (this.fsw.closed) {
|
|
256062
256151
|
return;
|
|
256063
256152
|
}
|
|
256064
|
-
const
|
|
256065
|
-
const
|
|
256066
|
-
const parent = this.fsw._getWatchedDir(
|
|
256153
|
+
const dirname19 = sp2.dirname(file2);
|
|
256154
|
+
const basename6 = sp2.basename(file2);
|
|
256155
|
+
const parent = this.fsw._getWatchedDir(dirname19);
|
|
256067
256156
|
let prevStats = stats;
|
|
256068
|
-
if (parent.has(
|
|
256157
|
+
if (parent.has(basename6))
|
|
256069
256158
|
return;
|
|
256070
256159
|
const listener = async (path19, newStats) => {
|
|
256071
256160
|
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5))
|
|
@@ -256090,9 +256179,9 @@ class NodeFsHandler {
|
|
|
256090
256179
|
prevStats = newStats2;
|
|
256091
256180
|
}
|
|
256092
256181
|
} catch (error48) {
|
|
256093
|
-
this.fsw._remove(
|
|
256182
|
+
this.fsw._remove(dirname19, basename6);
|
|
256094
256183
|
}
|
|
256095
|
-
} else if (parent.has(
|
|
256184
|
+
} else if (parent.has(basename6)) {
|
|
256096
256185
|
const at13 = newStats.atimeMs;
|
|
256097
256186
|
const mt12 = newStats.mtimeMs;
|
|
256098
256187
|
if (!at13 || at13 <= mt12 || mt12 !== prevStats.mtimeMs) {
|
|
@@ -256179,7 +256268,7 @@ class NodeFsHandler {
|
|
|
256179
256268
|
this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
|
|
256180
256269
|
}
|
|
256181
256270
|
}).on(EV.ERROR, this._boundHandleError);
|
|
256182
|
-
return new Promise((
|
|
256271
|
+
return new Promise((resolve11, reject) => {
|
|
256183
256272
|
if (!stream)
|
|
256184
256273
|
return reject();
|
|
256185
256274
|
stream.once(STR_END, () => {
|
|
@@ -256188,7 +256277,7 @@ class NodeFsHandler {
|
|
|
256188
256277
|
return;
|
|
256189
256278
|
}
|
|
256190
256279
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
256191
|
-
|
|
256280
|
+
resolve11(undefined);
|
|
256192
256281
|
previous.getChildren().filter((item) => {
|
|
256193
256282
|
return item !== directory && !current.has(item);
|
|
256194
256283
|
}).forEach((item) => {
|
|
@@ -257099,7 +257188,7 @@ async function createDevServer(options8) {
|
|
|
257099
257188
|
}
|
|
257100
257189
|
remoteProxy(req, res, next);
|
|
257101
257190
|
});
|
|
257102
|
-
const server = await new Promise((
|
|
257191
|
+
const server = await new Promise((resolve12, reject) => {
|
|
257103
257192
|
const s5 = app.listen(port, "127.0.0.1", (err) => {
|
|
257104
257193
|
if (err) {
|
|
257105
257194
|
if ("code" in err && err.code === "EADDRINUSE") {
|
|
@@ -257108,7 +257197,7 @@ async function createDevServer(options8) {
|
|
|
257108
257197
|
reject(err);
|
|
257109
257198
|
}
|
|
257110
257199
|
} else {
|
|
257111
|
-
|
|
257200
|
+
resolve12(s5);
|
|
257112
257201
|
}
|
|
257113
257202
|
});
|
|
257114
257203
|
});
|
|
@@ -257117,8 +257206,8 @@ async function createDevServer(options8) {
|
|
|
257117
257206
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
257118
257207
|
};
|
|
257119
257208
|
const base44ConfigWatcher = new WatchBase44({
|
|
257120
|
-
functions: join27(
|
|
257121
|
-
entities: join27(
|
|
257209
|
+
functions: join27(dirname20(project2.configPath), project2.functionsDir),
|
|
257210
|
+
entities: join27(dirname20(project2.configPath), project2.entitiesDir)
|
|
257122
257211
|
}, devLogger);
|
|
257123
257212
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
257124
257213
|
try {
|
|
@@ -257244,13 +257333,13 @@ async function runScript(options8) {
|
|
|
257244
257333
|
}
|
|
257245
257334
|
// src/cli/commands/exec.ts
|
|
257246
257335
|
function readStdin2() {
|
|
257247
|
-
return new Promise((
|
|
257336
|
+
return new Promise((resolve12, reject) => {
|
|
257248
257337
|
let data = "";
|
|
257249
257338
|
process.stdin.setEncoding("utf-8");
|
|
257250
257339
|
process.stdin.on("data", (chunk) => {
|
|
257251
257340
|
data += chunk;
|
|
257252
257341
|
});
|
|
257253
|
-
process.stdin.on("end", () =>
|
|
257342
|
+
process.stdin.on("end", () => resolve12(data));
|
|
257254
257343
|
process.stdin.on("error", reject);
|
|
257255
257344
|
});
|
|
257256
257345
|
}
|
|
@@ -257289,7 +257378,7 @@ Examples:
|
|
|
257289
257378
|
}
|
|
257290
257379
|
|
|
257291
257380
|
// src/cli/commands/project/eject.ts
|
|
257292
|
-
import { resolve as
|
|
257381
|
+
import { resolve as resolve12 } from "node:path";
|
|
257293
257382
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
257294
257383
|
async function eject(ctx, options8) {
|
|
257295
257384
|
const { log, runTask: runTask2, isNonInteractive } = ctx;
|
|
@@ -257345,7 +257434,7 @@ async function eject(ctx, options8) {
|
|
|
257345
257434
|
Ne("Operation cancelled.");
|
|
257346
257435
|
throw new CLIExitError(0);
|
|
257347
257436
|
}
|
|
257348
|
-
const resolvedPath =
|
|
257437
|
+
const resolvedPath = resolve12(selectedPath);
|
|
257349
257438
|
await runTask2("Downloading your project's code...", async (updateMessage) => {
|
|
257350
257439
|
await createProjectFilesForExistingProject({
|
|
257351
257440
|
projectId,
|
|
@@ -257403,6 +257492,7 @@ function createProgram(context) {
|
|
|
257403
257492
|
program2.addCommand(getWhoamiCommand());
|
|
257404
257493
|
program2.addCommand(getLogoutCommand());
|
|
257405
257494
|
program2.addCommand(getCreateCommand());
|
|
257495
|
+
program2.addCommand(getScaffoldCommand());
|
|
257406
257496
|
program2.addCommand(getDashboardCommand());
|
|
257407
257497
|
program2.addCommand(getDeployCommand2());
|
|
257408
257498
|
program2.addCommand(getLinkCommand());
|
|
@@ -257426,7 +257516,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
257426
257516
|
import { release, type } from "node:os";
|
|
257427
257517
|
|
|
257428
257518
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
257429
|
-
import { dirname as
|
|
257519
|
+
import { dirname as dirname21, posix, sep } from "path";
|
|
257430
257520
|
function createModulerModifier() {
|
|
257431
257521
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
257432
257522
|
return async (frames) => {
|
|
@@ -257435,7 +257525,7 @@ function createModulerModifier() {
|
|
|
257435
257525
|
return frames;
|
|
257436
257526
|
};
|
|
257437
257527
|
}
|
|
257438
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
257528
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname21(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
257439
257529
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
257440
257530
|
return (filename) => {
|
|
257441
257531
|
if (!filename)
|
|
@@ -259713,14 +259803,14 @@ async function addSourceContext(frames) {
|
|
|
259713
259803
|
return frames;
|
|
259714
259804
|
}
|
|
259715
259805
|
function getContextLinesFromFile(path19, ranges, output) {
|
|
259716
|
-
return new Promise((
|
|
259806
|
+
return new Promise((resolve13) => {
|
|
259717
259807
|
const stream = createReadStream2(path19);
|
|
259718
259808
|
const lineReaded = createInterface2({
|
|
259719
259809
|
input: stream
|
|
259720
259810
|
});
|
|
259721
259811
|
function destroyStreamAndResolve() {
|
|
259722
259812
|
stream.destroy();
|
|
259723
|
-
|
|
259813
|
+
resolve13();
|
|
259724
259814
|
}
|
|
259725
259815
|
let lineNumber = 0;
|
|
259726
259816
|
let currentRangeIndex = 0;
|
|
@@ -260832,15 +260922,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
260832
260922
|
return true;
|
|
260833
260923
|
if (this.featureFlagsPoller === undefined)
|
|
260834
260924
|
return false;
|
|
260835
|
-
return new Promise((
|
|
260925
|
+
return new Promise((resolve13) => {
|
|
260836
260926
|
const timeout3 = setTimeout(() => {
|
|
260837
260927
|
cleanup();
|
|
260838
|
-
|
|
260928
|
+
resolve13(false);
|
|
260839
260929
|
}, timeoutMs);
|
|
260840
260930
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
|
|
260841
260931
|
clearTimeout(timeout3);
|
|
260842
260932
|
cleanup();
|
|
260843
|
-
|
|
260933
|
+
resolve13(count2 > 0);
|
|
260844
260934
|
});
|
|
260845
260935
|
});
|
|
260846
260936
|
}
|
|
@@ -261624,7 +261714,7 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
|
|
|
261624
261714
|
});
|
|
261625
261715
|
}
|
|
261626
261716
|
// src/cli/index.ts
|
|
261627
|
-
var __dirname4 =
|
|
261717
|
+
var __dirname4 = dirname22(fileURLToPath6(import.meta.url));
|
|
261628
261718
|
async function runCLI(options8) {
|
|
261629
261719
|
ensureNpmAssets(join29(__dirname4, "../assets"));
|
|
261630
261720
|
const errorReporter = new ErrorReporter;
|
|
@@ -261663,4 +261753,4 @@ export {
|
|
|
261663
261753
|
CLIExitError
|
|
261664
261754
|
};
|
|
261665
261755
|
|
|
261666
|
-
//# debugId=
|
|
261756
|
+
//# debugId=658256F5939EB22064756E2164756E21
|