@base44-preview/cli 0.0.54-pr.535.dfef860 → 0.0.54-pr.537.21faea5
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 +156 -284
- package/dist/cli/index.js.map +9 -10
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -119063,12 +119063,12 @@ function getLanguageByFileName(languages2, file2) {
|
|
|
119063
119063
|
if (!file2) {
|
|
119064
119064
|
return;
|
|
119065
119065
|
}
|
|
119066
|
-
const
|
|
119066
|
+
const basename4 = getFileBasename(file2).toLowerCase();
|
|
119067
119067
|
return languages2.find(({
|
|
119068
119068
|
filenames
|
|
119069
|
-
}) => filenames?.some((name2) => name2.toLowerCase() ===
|
|
119069
|
+
}) => filenames?.some((name2) => name2.toLowerCase() === basename4)) ?? languages2.find(({
|
|
119070
119070
|
extensions
|
|
119071
|
-
}) => extensions?.some((extension) =>
|
|
119071
|
+
}) => extensions?.some((extension) => basename4.endsWith(extension)));
|
|
119072
119072
|
}
|
|
119073
119073
|
function getLanguageByLanguageName(languages2, languageName) {
|
|
119074
119074
|
if (!languageName) {
|
|
@@ -124290,8 +124290,8 @@ var init_prettier = __esm(() => {
|
|
|
124290
124290
|
}
|
|
124291
124291
|
exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
124292
124292
|
function isAffectDepthOfReadingPattern(pattern) {
|
|
124293
|
-
const
|
|
124294
|
-
return endsWithSlashGlobStar(pattern) || isStaticPattern(
|
|
124293
|
+
const basename4 = path152.basename(pattern);
|
|
124294
|
+
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename4);
|
|
124295
124295
|
}
|
|
124296
124296
|
exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
124297
124297
|
function expandPatternsWithBraceExpansion(patterns) {
|
|
@@ -134614,11 +134614,11 @@ var require_prettier = __commonJS((exports, module) => {
|
|
|
134614
134614
|
var require_formatter = __commonJS((exports) => {
|
|
134615
134615
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
|
|
134616
134616
|
function adopt(value) {
|
|
134617
|
-
return value instanceof P9 ? value : new P9(function(
|
|
134618
|
-
|
|
134617
|
+
return value instanceof P9 ? value : new P9(function(resolve9) {
|
|
134618
|
+
resolve9(value);
|
|
134619
134619
|
});
|
|
134620
134620
|
}
|
|
134621
|
-
return new (P9 || (P9 = Promise))(function(
|
|
134621
|
+
return new (P9 || (P9 = Promise))(function(resolve9, reject) {
|
|
134622
134622
|
function fulfilled(value) {
|
|
134623
134623
|
try {
|
|
134624
134624
|
step(generator.next(value));
|
|
@@ -134634,7 +134634,7 @@ var require_formatter = __commonJS((exports) => {
|
|
|
134634
134634
|
}
|
|
134635
134635
|
}
|
|
134636
134636
|
function step(result) {
|
|
134637
|
-
result.done ?
|
|
134637
|
+
result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
134638
134638
|
}
|
|
134639
134639
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
134640
134640
|
});
|
|
@@ -139287,7 +139287,7 @@ var require_url = __commonJS((exports) => {
|
|
|
139287
139287
|
};
|
|
139288
139288
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
139289
139289
|
exports.parse = undefined;
|
|
139290
|
-
exports.resolve =
|
|
139290
|
+
exports.resolve = resolve9;
|
|
139291
139291
|
exports.cwd = cwd;
|
|
139292
139292
|
exports.getProtocol = getProtocol;
|
|
139293
139293
|
exports.getExtension = getExtension;
|
|
@@ -139315,7 +139315,7 @@ var require_url = __commonJS((exports) => {
|
|
|
139315
139315
|
var urlDecodePatterns = [/%23/g, "#", /%24/g, "$", /%26/g, "&", /%2C/g, ",", /%40/g, "@"];
|
|
139316
139316
|
var parse11 = (u4) => new URL(u4);
|
|
139317
139317
|
exports.parse = parse11;
|
|
139318
|
-
function
|
|
139318
|
+
function resolve9(from, to5) {
|
|
139319
139319
|
const fromUrl = new URL((0, convert_path_to_posix_1.default)(from), "https://aaa.nonexistanturl.com");
|
|
139320
139320
|
const resolvedUrl = new URL((0, convert_path_to_posix_1.default)(to5), fromUrl);
|
|
139321
139321
|
const endSpaces = to5.match(/(\s*)$/)?.[1] || "";
|
|
@@ -139451,7 +139451,7 @@ var require_url = __commonJS((exports) => {
|
|
|
139451
139451
|
}
|
|
139452
139452
|
function relative4(from, to5) {
|
|
139453
139453
|
if (!isFileSystemPath(from) || !isFileSystemPath(to5)) {
|
|
139454
|
-
return
|
|
139454
|
+
return resolve9(from, to5);
|
|
139455
139455
|
}
|
|
139456
139456
|
const fromDir = path_1.default.dirname(stripHash(from));
|
|
139457
139457
|
const toPath4 = stripHash(to5);
|
|
@@ -140127,7 +140127,7 @@ var require_plugins = __commonJS((exports) => {
|
|
|
140127
140127
|
let plugin;
|
|
140128
140128
|
let lastError;
|
|
140129
140129
|
let index = 0;
|
|
140130
|
-
return new Promise((
|
|
140130
|
+
return new Promise((resolve9, reject) => {
|
|
140131
140131
|
runNextPlugin();
|
|
140132
140132
|
function runNextPlugin() {
|
|
140133
140133
|
plugin = plugins[index++];
|
|
@@ -140155,7 +140155,7 @@ var require_plugins = __commonJS((exports) => {
|
|
|
140155
140155
|
}
|
|
140156
140156
|
}
|
|
140157
140157
|
function onSuccess(result) {
|
|
140158
|
-
|
|
140158
|
+
resolve9({
|
|
140159
140159
|
plugin,
|
|
140160
140160
|
result
|
|
140161
140161
|
});
|
|
@@ -141488,11 +141488,11 @@ var require_lib3 = __commonJS((exports) => {
|
|
|
141488
141488
|
var require_resolver = __commonJS((exports) => {
|
|
141489
141489
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
|
|
141490
141490
|
function adopt(value) {
|
|
141491
|
-
return value instanceof P9 ? value : new P9(function(
|
|
141492
|
-
|
|
141491
|
+
return value instanceof P9 ? value : new P9(function(resolve9) {
|
|
141492
|
+
resolve9(value);
|
|
141493
141493
|
});
|
|
141494
141494
|
}
|
|
141495
|
-
return new (P9 || (P9 = Promise))(function(
|
|
141495
|
+
return new (P9 || (P9 = Promise))(function(resolve9, reject) {
|
|
141496
141496
|
function fulfilled(value) {
|
|
141497
141497
|
try {
|
|
141498
141498
|
step(generator.next(value));
|
|
@@ -141508,7 +141508,7 @@ var require_resolver = __commonJS((exports) => {
|
|
|
141508
141508
|
}
|
|
141509
141509
|
}
|
|
141510
141510
|
function step(result) {
|
|
141511
|
-
result.done ?
|
|
141511
|
+
result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
141512
141512
|
}
|
|
141513
141513
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
141514
141514
|
});
|
|
@@ -141629,11 +141629,11 @@ var require_optionValidator = __commonJS((exports) => {
|
|
|
141629
141629
|
var require_src3 = __commonJS((exports) => {
|
|
141630
141630
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
|
|
141631
141631
|
function adopt(value) {
|
|
141632
|
-
return value instanceof P9 ? value : new P9(function(
|
|
141633
|
-
|
|
141632
|
+
return value instanceof P9 ? value : new P9(function(resolve9) {
|
|
141633
|
+
resolve9(value);
|
|
141634
141634
|
});
|
|
141635
141635
|
}
|
|
141636
|
-
return new (P9 || (P9 = Promise))(function(
|
|
141636
|
+
return new (P9 || (P9 = Promise))(function(resolve9, reject) {
|
|
141637
141637
|
function fulfilled(value) {
|
|
141638
141638
|
try {
|
|
141639
141639
|
step(generator.next(value));
|
|
@@ -141649,7 +141649,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
141649
141649
|
}
|
|
141650
141650
|
}
|
|
141651
141651
|
function step(result) {
|
|
141652
|
-
result.done ?
|
|
141652
|
+
result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
141653
141653
|
}
|
|
141654
141654
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
141655
141655
|
});
|
|
@@ -147274,11 +147274,11 @@ var require_raw_body = __commonJS((exports, module) => {
|
|
|
147274
147274
|
if (done) {
|
|
147275
147275
|
return readStream(stream, encoding, length, limit, wrap(done));
|
|
147276
147276
|
}
|
|
147277
|
-
return new Promise(function executor(
|
|
147277
|
+
return new Promise(function executor(resolve9, reject) {
|
|
147278
147278
|
readStream(stream, encoding, length, limit, function onRead2(err, buf) {
|
|
147279
147279
|
if (err)
|
|
147280
147280
|
return reject(err);
|
|
147281
|
-
|
|
147281
|
+
resolve9(buf);
|
|
147282
147282
|
});
|
|
147283
147283
|
});
|
|
147284
147284
|
}
|
|
@@ -160400,10 +160400,10 @@ var require_view = __commonJS((exports, module) => {
|
|
|
160400
160400
|
var path18 = __require("node:path");
|
|
160401
160401
|
var fs28 = __require("node:fs");
|
|
160402
160402
|
var dirname17 = path18.dirname;
|
|
160403
|
-
var
|
|
160403
|
+
var basename4 = path18.basename;
|
|
160404
160404
|
var extname2 = path18.extname;
|
|
160405
160405
|
var join25 = path18.join;
|
|
160406
|
-
var
|
|
160406
|
+
var resolve9 = path18.resolve;
|
|
160407
160407
|
module.exports = View;
|
|
160408
160408
|
function View(name2, options8) {
|
|
160409
160409
|
var opts = options8 || {};
|
|
@@ -160437,9 +160437,9 @@ var require_view = __commonJS((exports, module) => {
|
|
|
160437
160437
|
debug('lookup "%s"', name2);
|
|
160438
160438
|
for (var i5 = 0;i5 < roots.length && !path19; i5++) {
|
|
160439
160439
|
var root2 = roots[i5];
|
|
160440
|
-
var loc =
|
|
160440
|
+
var loc = resolve9(root2, name2);
|
|
160441
160441
|
var dir = dirname17(loc);
|
|
160442
|
-
var file2 =
|
|
160442
|
+
var file2 = basename4(loc);
|
|
160443
160443
|
path19 = this.resolve(dir, file2);
|
|
160444
160444
|
}
|
|
160445
160445
|
return path19;
|
|
@@ -160462,14 +160462,14 @@ var require_view = __commonJS((exports, module) => {
|
|
|
160462
160462
|
});
|
|
160463
160463
|
sync = false;
|
|
160464
160464
|
};
|
|
160465
|
-
View.prototype.resolve = function
|
|
160465
|
+
View.prototype.resolve = function resolve10(dir, file2) {
|
|
160466
160466
|
var ext = this.ext;
|
|
160467
160467
|
var path19 = join25(dir, file2);
|
|
160468
160468
|
var stat2 = tryStat(path19);
|
|
160469
160469
|
if (stat2 && stat2.isFile()) {
|
|
160470
160470
|
return path19;
|
|
160471
160471
|
}
|
|
160472
|
-
path19 = join25(dir,
|
|
160472
|
+
path19 = join25(dir, basename4(file2, ext), "index" + ext);
|
|
160473
160473
|
stat2 = tryStat(path19);
|
|
160474
160474
|
if (stat2 && stat2.isFile()) {
|
|
160475
160475
|
return path19;
|
|
@@ -162621,7 +162621,7 @@ var require_application = __commonJS((exports, module) => {
|
|
|
162621
162621
|
var compileETag = require_utils10().compileETag;
|
|
162622
162622
|
var compileQueryParser = require_utils10().compileQueryParser;
|
|
162623
162623
|
var compileTrust = require_utils10().compileTrust;
|
|
162624
|
-
var
|
|
162624
|
+
var resolve9 = __require("node:path").resolve;
|
|
162625
162625
|
var once9 = require_once();
|
|
162626
162626
|
var Router = require_router();
|
|
162627
162627
|
var slice = Array.prototype.slice;
|
|
@@ -162675,7 +162675,7 @@ var require_application = __commonJS((exports, module) => {
|
|
|
162675
162675
|
this.mountpath = "/";
|
|
162676
162676
|
this.locals.settings = this.settings;
|
|
162677
162677
|
this.set("view", View);
|
|
162678
|
-
this.set("views",
|
|
162678
|
+
this.set("views", resolve9("views"));
|
|
162679
162679
|
this.set("jsonp callback name", "callback");
|
|
162680
162680
|
if (env3 === "production") {
|
|
162681
162681
|
this.enable("view cache");
|
|
@@ -163790,7 +163790,7 @@ var require_content_disposition = __commonJS((exports, module) => {
|
|
|
163790
163790
|
*/
|
|
163791
163791
|
module.exports = contentDisposition;
|
|
163792
163792
|
module.exports.parse = parse11;
|
|
163793
|
-
var
|
|
163793
|
+
var basename4 = __require("path").basename;
|
|
163794
163794
|
var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;
|
|
163795
163795
|
var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/;
|
|
163796
163796
|
var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g;
|
|
@@ -163825,9 +163825,9 @@ var require_content_disposition = __commonJS((exports, module) => {
|
|
|
163825
163825
|
if (typeof fallback === "string" && NON_LATIN1_REGEXP.test(fallback)) {
|
|
163826
163826
|
throw new TypeError("fallback must be ISO-8859-1 string");
|
|
163827
163827
|
}
|
|
163828
|
-
var name2 =
|
|
163828
|
+
var name2 = basename4(filename);
|
|
163829
163829
|
var isQuotedString = TEXT_REGEXP.test(name2);
|
|
163830
|
-
var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name2) :
|
|
163830
|
+
var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name2) : basename4(fallback);
|
|
163831
163831
|
var hasFallback = typeof fallbackName === "string" && fallbackName !== name2;
|
|
163832
163832
|
if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name2)) {
|
|
163833
163833
|
params["filename*"] = name2;
|
|
@@ -164166,7 +164166,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
164166
164166
|
var extname2 = path18.extname;
|
|
164167
164167
|
var join25 = path18.join;
|
|
164168
164168
|
var normalize2 = path18.normalize;
|
|
164169
|
-
var
|
|
164169
|
+
var resolve9 = path18.resolve;
|
|
164170
164170
|
var sep = path18.sep;
|
|
164171
164171
|
var BYTES_RANGE_REGEXP = /^ *bytes=/;
|
|
164172
164172
|
var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000;
|
|
@@ -164195,7 +164195,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
164195
164195
|
this._maxage = opts.maxAge || opts.maxage;
|
|
164196
164196
|
this._maxage = typeof this._maxage === "string" ? ms8(this._maxage) : Number(this._maxage);
|
|
164197
164197
|
this._maxage = !isNaN(this._maxage) ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) : 0;
|
|
164198
|
-
this._root = opts.root ?
|
|
164198
|
+
this._root = opts.root ? resolve9(opts.root) : null;
|
|
164199
164199
|
}
|
|
164200
164200
|
util2.inherits(SendStream, Stream2);
|
|
164201
164201
|
SendStream.prototype.error = function error48(status, err) {
|
|
@@ -164344,7 +164344,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
164344
164344
|
return res;
|
|
164345
164345
|
}
|
|
164346
164346
|
parts = normalize2(path19).split(sep);
|
|
164347
|
-
path19 =
|
|
164347
|
+
path19 = resolve9(path19);
|
|
164348
164348
|
}
|
|
164349
164349
|
if (containsDotFile(parts)) {
|
|
164350
164350
|
debug('%s dotfile "%s"', this._dotfiles, path19);
|
|
@@ -164672,7 +164672,7 @@ var require_response = __commonJS((exports, module) => {
|
|
|
164672
164672
|
var cookie = require_cookie();
|
|
164673
164673
|
var send = require_send();
|
|
164674
164674
|
var extname2 = path18.extname;
|
|
164675
|
-
var
|
|
164675
|
+
var resolve9 = path18.resolve;
|
|
164676
164676
|
var vary = require_vary();
|
|
164677
164677
|
var { Buffer: Buffer7 } = __require("node:buffer");
|
|
164678
164678
|
var res = Object.create(http.ServerResponse.prototype);
|
|
@@ -164881,7 +164881,7 @@ var require_response = __commonJS((exports, module) => {
|
|
|
164881
164881
|
}
|
|
164882
164882
|
opts = Object.create(opts);
|
|
164883
164883
|
opts.headers = headers;
|
|
164884
|
-
var fullPath = !opts.root ?
|
|
164884
|
+
var fullPath = !opts.root ? resolve9(path19) : path19;
|
|
164885
164885
|
return this.sendFile(fullPath, opts, done);
|
|
164886
164886
|
};
|
|
164887
164887
|
res.contentType = res.type = function contentType(type) {
|
|
@@ -165142,7 +165142,7 @@ var require_serve_static = __commonJS((exports, module) => {
|
|
|
165142
165142
|
var encodeUrl = require_encodeurl();
|
|
165143
165143
|
var escapeHtml = require_escape_html();
|
|
165144
165144
|
var parseUrl = require_parseurl();
|
|
165145
|
-
var
|
|
165145
|
+
var resolve9 = __require("path").resolve;
|
|
165146
165146
|
var send = require_send();
|
|
165147
165147
|
var url3 = __require("url");
|
|
165148
165148
|
module.exports = serveStatic;
|
|
@@ -165161,7 +165161,7 @@ var require_serve_static = __commonJS((exports, module) => {
|
|
|
165161
165161
|
throw new TypeError("option setHeaders must be function");
|
|
165162
165162
|
}
|
|
165163
165163
|
opts.maxage = opts.maxage || opts.maxAge || 0;
|
|
165164
|
-
opts.root =
|
|
165164
|
+
opts.root = resolve9(root2);
|
|
165165
165165
|
var onDirectory = redirect ? createRedirectDirectoryListener() : createNotFoundDirectoryListener();
|
|
165166
165166
|
return function serveStatic2(req, res, next) {
|
|
165167
165167
|
if (req.method !== "GET" && req.method !== "HEAD") {
|
|
@@ -167724,8 +167724,8 @@ var require_tmp = __commonJS((exports, module) => {
|
|
|
167724
167724
|
const name2 = options8.name;
|
|
167725
167725
|
if (path18.isAbsolute(name2))
|
|
167726
167726
|
throw new Error(`name option must not contain an absolute path, found "${name2}".`);
|
|
167727
|
-
const
|
|
167728
|
-
if (
|
|
167727
|
+
const basename4 = path18.basename(name2);
|
|
167728
|
+
if (basename4 === ".." || basename4 === "." || basename4 !== name2)
|
|
167729
167729
|
throw new Error(`name option must not contain a path, found "${name2}".`);
|
|
167730
167730
|
}
|
|
167731
167731
|
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((resolve9) => {
|
|
172084
|
+
this._triggerBuffer = resolve9;
|
|
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((resolve9, 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
|
+
resolve9();
|
|
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((resolve9, 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
|
+
resolve9({ 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((resolve9, 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 resolve9(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((resolve9, reject) => {
|
|
199141
199141
|
args.push((arg1, arg2) => {
|
|
199142
199142
|
if (withErr) {
|
|
199143
|
-
return arg1 ? reject(arg1) :
|
|
199143
|
+
return arg1 ? reject(arg1) : resolve9(arg2);
|
|
199144
199144
|
} else {
|
|
199145
|
-
return
|
|
199145
|
+
return resolve9(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((resolve9, 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 resolve9(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((resolve9, 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: resolve9,
|
|
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((resolve9, 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: resolve9,
|
|
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((resolve9) => {
|
|
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
|
+
resolve9();
|
|
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 basename4(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: basename4,
|
|
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: basename4,
|
|
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 = basename4(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 resolve9 = iter[kLastResolve];
|
|
215918
|
+
if (resolve9 !== 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
|
+
resolve9(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(resolve9, reject) {
|
|
215933
215933
|
lastPromise.then(function() {
|
|
215934
215934
|
if (iter[kEnded]) {
|
|
215935
|
-
|
|
215935
|
+
resolve9(createIterResult(undefined, true));
|
|
215936
215936
|
return;
|
|
215937
215937
|
}
|
|
215938
|
-
iter[kHandlePromise](
|
|
215938
|
+
iter[kHandlePromise](resolve9, 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(resolve9, reject) {
|
|
215958
215958
|
process.nextTick(function() {
|
|
215959
215959
|
if (_this[kError]) {
|
|
215960
215960
|
reject(_this[kError]);
|
|
215961
215961
|
} else {
|
|
215962
|
-
|
|
215962
|
+
resolve9(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(resolve9, reject) {
|
|
215986
215986
|
_this2[kStream].destroy(null, function(err) {
|
|
215987
215987
|
if (err) {
|
|
215988
215988
|
reject(err);
|
|
215989
215989
|
return;
|
|
215990
215990
|
}
|
|
215991
|
-
|
|
215991
|
+
resolve9(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(resolve9, 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
|
+
resolve9(createIterResult(data, false));
|
|
216020
216020
|
} else {
|
|
216021
|
-
iterator[kLastResolve] =
|
|
216021
|
+
iterator[kLastResolve] = resolve9;
|
|
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 resolve9 = iterator[kLastResolve];
|
|
216041
|
+
if (resolve9 !== null) {
|
|
216042
216042
|
iterator[kLastPromise] = null;
|
|
216043
216043
|
iterator[kLastResolve] = null;
|
|
216044
216044
|
iterator[kLastReject] = null;
|
|
216045
|
-
|
|
216045
|
+
resolve9(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, resolve9, 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
|
+
resolve9(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(resolve9, reject) {
|
|
216075
216075
|
var gen = fn9.apply(self2, args);
|
|
216076
216076
|
function _next(value) {
|
|
216077
|
-
asyncGeneratorStep(gen,
|
|
216077
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "next", value);
|
|
216078
216078
|
}
|
|
216079
216079
|
function _throw(err) {
|
|
216080
|
-
asyncGeneratorStep(gen,
|
|
216080
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "throw", err);
|
|
216081
216081
|
}
|
|
216082
216082
|
_next(undefined);
|
|
216083
216083
|
});
|
|
@@ -235154,10 +235154,38 @@ function getTestOverrides() {
|
|
|
235154
235154
|
// src/core/auth/config.ts
|
|
235155
235155
|
var TOKEN_REFRESH_BUFFER_MS = 60 * 1000;
|
|
235156
235156
|
var refreshPromise = null;
|
|
235157
|
-
function
|
|
235158
|
-
|
|
235157
|
+
function decodeJwtClaims(token) {
|
|
235158
|
+
const parts = token.split(".");
|
|
235159
|
+
if (parts.length !== 3) {
|
|
235160
|
+
return null;
|
|
235161
|
+
}
|
|
235162
|
+
try {
|
|
235163
|
+
return JSON.parse(Buffer.from(parts[1], "base64url").toString("utf8"));
|
|
235164
|
+
} catch {
|
|
235165
|
+
return null;
|
|
235166
|
+
}
|
|
235167
|
+
}
|
|
235168
|
+
function readEnvAuth() {
|
|
235169
|
+
const accessToken = process.env.BASE44_ACCESS_TOKEN;
|
|
235170
|
+
if (!accessToken) {
|
|
235171
|
+
return null;
|
|
235172
|
+
}
|
|
235173
|
+
const claims = decodeJwtClaims(accessToken);
|
|
235174
|
+
const sub = typeof claims?.sub === "string" ? claims.sub : "";
|
|
235175
|
+
const exp = typeof claims?.exp === "number" ? claims.exp : null;
|
|
235176
|
+
return {
|
|
235177
|
+
accessToken,
|
|
235178
|
+
refreshToken: process.env.BASE44_REFRESH_TOKEN ?? "",
|
|
235179
|
+
expiresAt: exp !== null ? exp * 1000 : Number.POSITIVE_INFINITY,
|
|
235180
|
+
email: sub,
|
|
235181
|
+
name: ""
|
|
235182
|
+
};
|
|
235159
235183
|
}
|
|
235160
235184
|
async function readAuth() {
|
|
235185
|
+
const envAuth = readEnvAuth();
|
|
235186
|
+
if (envAuth) {
|
|
235187
|
+
return envAuth;
|
|
235188
|
+
}
|
|
235161
235189
|
try {
|
|
235162
235190
|
const authData = await readJsonFile(getAuthFilePath());
|
|
235163
235191
|
const result = AuthDataSchema.safeParse(authData);
|
|
@@ -235194,6 +235222,9 @@ function isTokenExpired(auth) {
|
|
|
235194
235222
|
return Date.now() >= auth.expiresAt - TOKEN_REFRESH_BUFFER_MS;
|
|
235195
235223
|
}
|
|
235196
235224
|
async function refreshAndSaveTokens() {
|
|
235225
|
+
if (readEnvAuth()) {
|
|
235226
|
+
return null;
|
|
235227
|
+
}
|
|
235197
235228
|
if (refreshPromise) {
|
|
235198
235229
|
return refreshPromise;
|
|
235199
235230
|
}
|
|
@@ -235218,9 +235249,6 @@ async function refreshAndSaveTokens() {
|
|
|
235218
235249
|
return refreshPromise;
|
|
235219
235250
|
}
|
|
235220
235251
|
async function isLoggedIn() {
|
|
235221
|
-
if (getEnvAccessToken()) {
|
|
235222
|
-
return true;
|
|
235223
|
-
}
|
|
235224
235252
|
try {
|
|
235225
235253
|
await readAuth();
|
|
235226
235254
|
return true;
|
|
@@ -243975,15 +244003,13 @@ async function listTemplates() {
|
|
|
243975
244003
|
}
|
|
243976
244004
|
return result.data.templates;
|
|
243977
244005
|
}
|
|
243978
|
-
async function renderTemplate(template, destPath, data
|
|
243979
|
-
const { skipExisting = false } = options;
|
|
244006
|
+
async function renderTemplate(template, destPath, data) {
|
|
243980
244007
|
const templateDir = join12(getTemplatesDir(), template.path);
|
|
243981
244008
|
const files = await globby("**/*", {
|
|
243982
244009
|
cwd: templateDir,
|
|
243983
244010
|
dot: true,
|
|
243984
244011
|
onlyFiles: true
|
|
243985
244012
|
});
|
|
243986
|
-
const skipped = [];
|
|
243987
244013
|
for (const file2 of files) {
|
|
243988
244014
|
const srcPath = join12(templateDir, file2);
|
|
243989
244015
|
try {
|
|
@@ -243992,17 +244018,9 @@ async function renderTemplate(template, destPath, data, options = {}) {
|
|
|
243992
244018
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
243993
244019
|
const destFile = attributes.outputFileName ? join12(dirname7(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
243994
244020
|
const destFilePath = join12(destPath, destFile);
|
|
243995
|
-
if (skipExisting && await pathExists(destFilePath)) {
|
|
243996
|
-
skipped.push(destFile);
|
|
243997
|
-
continue;
|
|
243998
|
-
}
|
|
243999
244021
|
await writeFile(destFilePath, body);
|
|
244000
244022
|
} else {
|
|
244001
244023
|
const destFilePath = join12(destPath, file2);
|
|
244002
|
-
if (skipExisting && await pathExists(destFilePath)) {
|
|
244003
|
-
skipped.push(file2);
|
|
244004
|
-
continue;
|
|
244005
|
-
}
|
|
244006
244024
|
await copyFile(srcPath, destFilePath);
|
|
244007
244025
|
}
|
|
244008
244026
|
} catch (error48) {
|
|
@@ -244010,7 +244028,6 @@ async function renderTemplate(template, destPath, data, options = {}) {
|
|
|
244010
244028
|
throw new Error(`Failed to process template file "${file2}": ${message}`);
|
|
244011
244029
|
}
|
|
244012
244030
|
}
|
|
244013
|
-
return skipped;
|
|
244014
244031
|
}
|
|
244015
244032
|
|
|
244016
244033
|
// src/core/project/create.ts
|
|
@@ -244033,20 +244050,6 @@ async function createProjectFiles(options) {
|
|
|
244033
244050
|
projectDir: basePath
|
|
244034
244051
|
};
|
|
244035
244052
|
}
|
|
244036
|
-
async function initProjectFiles(options) {
|
|
244037
|
-
const { name: name2, description, path: basePath, template, appId } = options;
|
|
244038
|
-
await assertProjectNotExists(basePath);
|
|
244039
|
-
const skippedFiles = await renderTemplate(template, basePath, {
|
|
244040
|
-
name: name2,
|
|
244041
|
-
description,
|
|
244042
|
-
projectId: appId
|
|
244043
|
-
}, { skipExisting: true });
|
|
244044
|
-
return {
|
|
244045
|
-
projectId: appId,
|
|
244046
|
-
projectDir: basePath,
|
|
244047
|
-
skippedFiles
|
|
244048
|
-
};
|
|
244049
|
-
}
|
|
244050
244053
|
async function createProjectFilesForExistingProject(options) {
|
|
244051
244054
|
const { projectId, projectPath } = options;
|
|
244052
244055
|
await assertProjectNotExists(projectPath);
|
|
@@ -244171,9 +244174,6 @@ async function handleUnauthorized(request, _options, response) {
|
|
|
244171
244174
|
if (retriedRequests.has(request)) {
|
|
244172
244175
|
return;
|
|
244173
244176
|
}
|
|
244174
|
-
if (getEnvAccessToken()) {
|
|
244175
|
-
return;
|
|
244176
|
-
}
|
|
244177
244177
|
const newAccessToken = await refreshAndSaveTokens();
|
|
244178
244178
|
if (!newAccessToken) {
|
|
244179
244179
|
return;
|
|
@@ -244200,11 +244200,6 @@ var base44Client = distribution_default.create({
|
|
|
244200
244200
|
captureRequestBody,
|
|
244201
244201
|
async (request) => {
|
|
244202
244202
|
try {
|
|
244203
|
-
const envToken = getEnvAccessToken();
|
|
244204
|
-
if (envToken) {
|
|
244205
|
-
request.headers.set("Authorization", `Bearer ${envToken}`);
|
|
244206
|
-
return;
|
|
244207
|
-
}
|
|
244208
244203
|
const auth = await readAuth();
|
|
244209
244204
|
if (isTokenExpired(auth)) {
|
|
244210
244205
|
const newAccessToken = await refreshAndSaveTokens();
|
|
@@ -251786,7 +251781,8 @@ function getLogoutCommand() {
|
|
|
251786
251781
|
// src/cli/commands/auth/whoami.ts
|
|
251787
251782
|
async function whoami(_ctx) {
|
|
251788
251783
|
const auth2 = await readAuth();
|
|
251789
|
-
|
|
251784
|
+
const identity4 = auth2.email || "environment credentials";
|
|
251785
|
+
return { outroMessage: `Logged in as: ${theme.styles.bold(identity4)}` };
|
|
251790
251786
|
}
|
|
251791
251787
|
function getWhoamiCommand() {
|
|
251792
251788
|
return new Base44Command("whoami", { requireAppConfig: false }).description("Display current authenticated user").action(whoami);
|
|
@@ -253256,129 +253252,6 @@ function printStripeResult(r, log) {
|
|
|
253256
253252
|
log.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
|
|
253257
253253
|
}
|
|
253258
253254
|
|
|
253259
|
-
// src/cli/commands/project/init.ts
|
|
253260
|
-
import { basename as basename4, resolve as resolve6 } from "node:path";
|
|
253261
|
-
function resolveAppId(options) {
|
|
253262
|
-
const appId = options.appId ?? process.env.BASE44_APP_ID;
|
|
253263
|
-
if (!appId) {
|
|
253264
|
-
throw new InvalidInputError("No app ID found. `base44 init` scaffolds a local project for an existing Base44 app.", {
|
|
253265
|
-
hints: [
|
|
253266
|
-
{ message: "Pass it explicitly with --app-id <id>" },
|
|
253267
|
-
{
|
|
253268
|
-
message: "Or set BASE44_APP_ID (the Stripe Projects CLI writes it to .env via `stripe projects env --pull`)"
|
|
253269
|
-
}
|
|
253270
|
-
]
|
|
253271
|
-
});
|
|
253272
|
-
}
|
|
253273
|
-
return appId;
|
|
253274
|
-
}
|
|
253275
|
-
async function executeInit({
|
|
253276
|
-
template: template2,
|
|
253277
|
-
name: rawName,
|
|
253278
|
-
description,
|
|
253279
|
-
appId,
|
|
253280
|
-
projectPath,
|
|
253281
|
-
deploy: deploy5,
|
|
253282
|
-
skills,
|
|
253283
|
-
isInteractive
|
|
253284
|
-
}, { log, runTask: runTask2 }) {
|
|
253285
|
-
const name2 = rawName.trim();
|
|
253286
|
-
const resolvedPath = resolve6(projectPath);
|
|
253287
|
-
const { projectId, skippedFiles } = await runTask2("Setting up your project...", async () => {
|
|
253288
|
-
return await initProjectFiles({
|
|
253289
|
-
name: name2,
|
|
253290
|
-
description: description?.trim(),
|
|
253291
|
-
path: resolvedPath,
|
|
253292
|
-
template: template2,
|
|
253293
|
-
appId
|
|
253294
|
-
});
|
|
253295
|
-
}, {
|
|
253296
|
-
successMessage: theme.colors.base44Orange("Project created successfully"),
|
|
253297
|
-
errorMessage: "Failed to create project"
|
|
253298
|
-
});
|
|
253299
|
-
if (skippedFiles.length > 0) {
|
|
253300
|
-
log.info(`Kept existing file${skippedFiles.length > 1 ? "s" : ""}: ${skippedFiles.join(", ")}`);
|
|
253301
|
-
}
|
|
253302
|
-
setAppConfig({ id: projectId, projectRoot: resolvedPath });
|
|
253303
|
-
return await completeProjectSetup({ projectId, name: name2, resolvedPath, deploy: deploy5, skills, isInteractive }, { log, runTask: runTask2 });
|
|
253304
|
-
}
|
|
253305
|
-
async function initInteractive(appId, options, ctx) {
|
|
253306
|
-
const templates = await listTemplates();
|
|
253307
|
-
const templateOptions = templates.map((t) => ({
|
|
253308
|
-
value: t,
|
|
253309
|
-
label: t.name,
|
|
253310
|
-
hint: t.description
|
|
253311
|
-
}));
|
|
253312
|
-
const result = await Oe({
|
|
253313
|
-
template: () => Je({
|
|
253314
|
-
message: "Pick an option",
|
|
253315
|
-
options: templateOptions
|
|
253316
|
-
}),
|
|
253317
|
-
name: () => {
|
|
253318
|
-
return options.name ? Promise.resolve(options.name) : Ze({
|
|
253319
|
-
message: "What is the name of your project?",
|
|
253320
|
-
placeholder: basename4(process.cwd()),
|
|
253321
|
-
initialValue: basename4(process.cwd()),
|
|
253322
|
-
validate: (value) => {
|
|
253323
|
-
if (!value || value.trim().length === 0) {
|
|
253324
|
-
return "Every project deserves a name";
|
|
253325
|
-
}
|
|
253326
|
-
}
|
|
253327
|
-
});
|
|
253328
|
-
},
|
|
253329
|
-
projectPath: () => Ze({
|
|
253330
|
-
message: "Where should we set up your project?",
|
|
253331
|
-
placeholder: "./",
|
|
253332
|
-
initialValue: options.path ?? "./"
|
|
253333
|
-
})
|
|
253334
|
-
}, {
|
|
253335
|
-
onCancel: onPromptCancel
|
|
253336
|
-
});
|
|
253337
|
-
return await executeInit({
|
|
253338
|
-
template: result.template,
|
|
253339
|
-
name: result.name,
|
|
253340
|
-
appId,
|
|
253341
|
-
projectPath: result.projectPath,
|
|
253342
|
-
deploy: options.deploy,
|
|
253343
|
-
skills: options.skills,
|
|
253344
|
-
isInteractive: true
|
|
253345
|
-
}, ctx);
|
|
253346
|
-
}
|
|
253347
|
-
async function initNonInteractive(appId, options, ctx) {
|
|
253348
|
-
const projectPath = options.path ?? "./";
|
|
253349
|
-
const name2 = options.name ?? basename4(resolve6(projectPath));
|
|
253350
|
-
ctx.log.info(`Initializing project at ${resolve6(projectPath)}`);
|
|
253351
|
-
const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
|
|
253352
|
-
return await executeInit({
|
|
253353
|
-
template: template2,
|
|
253354
|
-
name: name2,
|
|
253355
|
-
appId,
|
|
253356
|
-
projectPath,
|
|
253357
|
-
deploy: options.deploy,
|
|
253358
|
-
skills: options.skills,
|
|
253359
|
-
isInteractive: false
|
|
253360
|
-
}, ctx);
|
|
253361
|
-
}
|
|
253362
|
-
async function initAction({ log, runTask: runTask2, isNonInteractive }, name2, options) {
|
|
253363
|
-
const appId = resolveAppId(options);
|
|
253364
|
-
const opts = { ...options, name: options.name ?? name2 };
|
|
253365
|
-
const ctx = { log, runTask: runTask2 };
|
|
253366
|
-
if (isNonInteractive) {
|
|
253367
|
-
return await initNonInteractive(appId, opts, ctx);
|
|
253368
|
-
}
|
|
253369
|
-
return await initInteractive(appId, opts, ctx);
|
|
253370
|
-
}
|
|
253371
|
-
function getInitCommand() {
|
|
253372
|
-
return new Base44Command("init", {
|
|
253373
|
-
requireAppConfig: false,
|
|
253374
|
-
fullBanner: true
|
|
253375
|
-
}).description("Scaffold a local project for an existing Base44 app (e.g. one provisioned by the Stripe Projects CLI)").addArgument(new Argument("name", "Project name").argOptional()).option("--app-id <id>", "Existing Base44 app ID (defaults to the BASE44_APP_ID environment variable)").option("-p, --path <path>", "Path where to set up the project (defaults to the current directory)").option("-t, --template <id>", "Template ID (e.g., backend-only, backend-and-client)").option("--deploy", "Build and deploy the site").option("--no-skills", "Skip AI agent skills installation").addHelpText("after", `
|
|
253376
|
-
Examples:
|
|
253377
|
-
$ base44 init Scaffolds in the current dir using $BASE44_APP_ID
|
|
253378
|
-
$ base44 init --app-id app_123 Scaffolds in the current dir for the given app
|
|
253379
|
-
$ base44 init my-app --app-id app_123 Scaffolds in the current dir named "my-app"`).action(initAction);
|
|
253380
|
-
}
|
|
253381
|
-
|
|
253382
253255
|
// src/cli/commands/project/link.ts
|
|
253383
253256
|
function validateNonInteractiveFlags2(command2) {
|
|
253384
253257
|
const { create: create4, name: name2, projectId } = command2.opts();
|
|
@@ -253691,7 +253564,7 @@ function getSecretsListCommand() {
|
|
|
253691
253564
|
}
|
|
253692
253565
|
|
|
253693
253566
|
// src/cli/commands/secrets/set.ts
|
|
253694
|
-
import { resolve as
|
|
253567
|
+
import { resolve as resolve6 } from "node:path";
|
|
253695
253568
|
function parseEntries(entries) {
|
|
253696
253569
|
const secrets = {};
|
|
253697
253570
|
for (const entry of entries) {
|
|
@@ -253722,7 +253595,7 @@ async function setSecretsAction({ log, runTask: runTask2 }, entries, options) {
|
|
|
253722
253595
|
validateInput(entries, options);
|
|
253723
253596
|
let secrets;
|
|
253724
253597
|
if (options.envFile) {
|
|
253725
|
-
secrets = await parseEnvFile(
|
|
253598
|
+
secrets = await parseEnvFile(resolve6(options.envFile));
|
|
253726
253599
|
if (Object.keys(secrets).length === 0) {
|
|
253727
253600
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
253728
253601
|
}
|
|
@@ -253751,7 +253624,7 @@ function getSecretsCommand() {
|
|
|
253751
253624
|
}
|
|
253752
253625
|
|
|
253753
253626
|
// src/cli/commands/site/deploy.ts
|
|
253754
|
-
import { resolve as
|
|
253627
|
+
import { resolve as resolve7 } from "node:path";
|
|
253755
253628
|
async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
253756
253629
|
if (isNonInteractive && !options.yes) {
|
|
253757
253630
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
@@ -253766,7 +253639,7 @@ async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
|
253766
253639
|
]
|
|
253767
253640
|
});
|
|
253768
253641
|
}
|
|
253769
|
-
const outputDir =
|
|
253642
|
+
const outputDir = resolve7(project2.root, project2.site.outputDirectory);
|
|
253770
253643
|
if (!options.yes) {
|
|
253771
253644
|
const shouldDeploy = await Re({
|
|
253772
253645
|
message: `Deploy site from ${project2.site.outputDirectory}?`
|
|
@@ -253971,14 +253844,14 @@ var getLocalHosts = () => {
|
|
|
253971
253844
|
}
|
|
253972
253845
|
return results;
|
|
253973
253846
|
};
|
|
253974
|
-
var checkAvailablePort = (options8) => new Promise((
|
|
253847
|
+
var checkAvailablePort = (options8) => new Promise((resolve9, reject) => {
|
|
253975
253848
|
const server = net.createServer();
|
|
253976
253849
|
server.unref();
|
|
253977
253850
|
server.on("error", reject);
|
|
253978
253851
|
server.listen(options8, () => {
|
|
253979
253852
|
const { port } = server.address();
|
|
253980
253853
|
server.close(() => {
|
|
253981
|
-
|
|
253854
|
+
resolve9(port);
|
|
253982
253855
|
});
|
|
253983
253856
|
});
|
|
253984
253857
|
});
|
|
@@ -254238,7 +254111,7 @@ class FunctionManager {
|
|
|
254238
254111
|
});
|
|
254239
254112
|
}
|
|
254240
254113
|
waitForReady(name2, runningFunc) {
|
|
254241
|
-
return new Promise((
|
|
254114
|
+
return new Promise((resolve9, reject) => {
|
|
254242
254115
|
runningFunc.process.on("exit", (code2) => {
|
|
254243
254116
|
if (!runningFunc.ready) {
|
|
254244
254117
|
clearTimeout(timeout3);
|
|
@@ -254261,7 +254134,7 @@ class FunctionManager {
|
|
|
254261
254134
|
runningFunc.ready = true;
|
|
254262
254135
|
clearTimeout(timeout3);
|
|
254263
254136
|
runningFunc.process.stdout?.off("data", onData);
|
|
254264
|
-
|
|
254137
|
+
resolve9(runningFunc.port);
|
|
254265
254138
|
}
|
|
254266
254139
|
};
|
|
254267
254140
|
runningFunc.process.stdout?.on("data", onData);
|
|
@@ -255640,10 +255513,10 @@ class ReaddirpStream extends Readable6 {
|
|
|
255640
255513
|
}
|
|
255641
255514
|
async _formatEntry(dirent, path19) {
|
|
255642
255515
|
let entry;
|
|
255643
|
-
const
|
|
255516
|
+
const basename4 = this._isDirent ? dirent.name : dirent;
|
|
255644
255517
|
try {
|
|
255645
|
-
const fullPath = presolve(pjoin(path19,
|
|
255646
|
-
entry = { path: prelative(this._root, fullPath), fullPath, basename:
|
|
255518
|
+
const fullPath = presolve(pjoin(path19, basename4));
|
|
255519
|
+
entry = { path: prelative(this._root, fullPath), fullPath, basename: basename4 };
|
|
255647
255520
|
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
255648
255521
|
} catch (err) {
|
|
255649
255522
|
this._onError(err);
|
|
@@ -256170,9 +256043,9 @@ class NodeFsHandler {
|
|
|
256170
256043
|
_watchWithNodeFs(path19, listener) {
|
|
256171
256044
|
const opts = this.fsw.options;
|
|
256172
256045
|
const directory = sp2.dirname(path19);
|
|
256173
|
-
const
|
|
256046
|
+
const basename5 = sp2.basename(path19);
|
|
256174
256047
|
const parent = this.fsw._getWatchedDir(directory);
|
|
256175
|
-
parent.add(
|
|
256048
|
+
parent.add(basename5);
|
|
256176
256049
|
const absolutePath = sp2.resolve(path19);
|
|
256177
256050
|
const options8 = {
|
|
256178
256051
|
persistent: opts.persistent
|
|
@@ -256182,7 +256055,7 @@ class NodeFsHandler {
|
|
|
256182
256055
|
let closer;
|
|
256183
256056
|
if (opts.usePolling) {
|
|
256184
256057
|
const enableBin = opts.interval !== opts.binaryInterval;
|
|
256185
|
-
options8.interval = enableBin && isBinaryPath(
|
|
256058
|
+
options8.interval = enableBin && isBinaryPath(basename5) ? opts.binaryInterval : opts.interval;
|
|
256186
256059
|
closer = setFsWatchFileListener(path19, absolutePath, options8, {
|
|
256187
256060
|
listener,
|
|
256188
256061
|
rawEmitter: this.fsw._emitRaw
|
|
@@ -256201,10 +256074,10 @@ class NodeFsHandler {
|
|
|
256201
256074
|
return;
|
|
256202
256075
|
}
|
|
256203
256076
|
const dirname18 = sp2.dirname(file2);
|
|
256204
|
-
const
|
|
256077
|
+
const basename5 = sp2.basename(file2);
|
|
256205
256078
|
const parent = this.fsw._getWatchedDir(dirname18);
|
|
256206
256079
|
let prevStats = stats;
|
|
256207
|
-
if (parent.has(
|
|
256080
|
+
if (parent.has(basename5))
|
|
256208
256081
|
return;
|
|
256209
256082
|
const listener = async (path19, newStats) => {
|
|
256210
256083
|
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5))
|
|
@@ -256229,9 +256102,9 @@ class NodeFsHandler {
|
|
|
256229
256102
|
prevStats = newStats2;
|
|
256230
256103
|
}
|
|
256231
256104
|
} catch (error48) {
|
|
256232
|
-
this.fsw._remove(dirname18,
|
|
256105
|
+
this.fsw._remove(dirname18, basename5);
|
|
256233
256106
|
}
|
|
256234
|
-
} else if (parent.has(
|
|
256107
|
+
} else if (parent.has(basename5)) {
|
|
256235
256108
|
const at13 = newStats.atimeMs;
|
|
256236
256109
|
const mt12 = newStats.mtimeMs;
|
|
256237
256110
|
if (!at13 || at13 <= mt12 || mt12 !== prevStats.mtimeMs) {
|
|
@@ -256318,7 +256191,7 @@ class NodeFsHandler {
|
|
|
256318
256191
|
this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
|
|
256319
256192
|
}
|
|
256320
256193
|
}).on(EV.ERROR, this._boundHandleError);
|
|
256321
|
-
return new Promise((
|
|
256194
|
+
return new Promise((resolve10, reject) => {
|
|
256322
256195
|
if (!stream)
|
|
256323
256196
|
return reject();
|
|
256324
256197
|
stream.once(STR_END, () => {
|
|
@@ -256327,7 +256200,7 @@ class NodeFsHandler {
|
|
|
256327
256200
|
return;
|
|
256328
256201
|
}
|
|
256329
256202
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
256330
|
-
|
|
256203
|
+
resolve10(undefined);
|
|
256331
256204
|
previous.getChildren().filter((item) => {
|
|
256332
256205
|
return item !== directory && !current.has(item);
|
|
256333
256206
|
}).forEach((item) => {
|
|
@@ -257238,7 +257111,7 @@ async function createDevServer(options8) {
|
|
|
257238
257111
|
}
|
|
257239
257112
|
remoteProxy(req, res, next);
|
|
257240
257113
|
});
|
|
257241
|
-
const server = await new Promise((
|
|
257114
|
+
const server = await new Promise((resolve11, reject) => {
|
|
257242
257115
|
const s5 = app.listen(port, "127.0.0.1", (err) => {
|
|
257243
257116
|
if (err) {
|
|
257244
257117
|
if ("code" in err && err.code === "EADDRINUSE") {
|
|
@@ -257247,7 +257120,7 @@ async function createDevServer(options8) {
|
|
|
257247
257120
|
reject(err);
|
|
257248
257121
|
}
|
|
257249
257122
|
} else {
|
|
257250
|
-
|
|
257123
|
+
resolve11(s5);
|
|
257251
257124
|
}
|
|
257252
257125
|
});
|
|
257253
257126
|
});
|
|
@@ -257383,13 +257256,13 @@ async function runScript(options8) {
|
|
|
257383
257256
|
}
|
|
257384
257257
|
// src/cli/commands/exec.ts
|
|
257385
257258
|
function readStdin2() {
|
|
257386
|
-
return new Promise((
|
|
257259
|
+
return new Promise((resolve11, reject) => {
|
|
257387
257260
|
let data = "";
|
|
257388
257261
|
process.stdin.setEncoding("utf-8");
|
|
257389
257262
|
process.stdin.on("data", (chunk) => {
|
|
257390
257263
|
data += chunk;
|
|
257391
257264
|
});
|
|
257392
|
-
process.stdin.on("end", () =>
|
|
257265
|
+
process.stdin.on("end", () => resolve11(data));
|
|
257393
257266
|
process.stdin.on("error", reject);
|
|
257394
257267
|
});
|
|
257395
257268
|
}
|
|
@@ -257428,7 +257301,7 @@ Examples:
|
|
|
257428
257301
|
}
|
|
257429
257302
|
|
|
257430
257303
|
// src/cli/commands/project/eject.ts
|
|
257431
|
-
import { resolve as
|
|
257304
|
+
import { resolve as resolve11 } from "node:path";
|
|
257432
257305
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
257433
257306
|
async function eject(ctx, options8) {
|
|
257434
257307
|
const { log, runTask: runTask2, isNonInteractive } = ctx;
|
|
@@ -257484,7 +257357,7 @@ async function eject(ctx, options8) {
|
|
|
257484
257357
|
Ne("Operation cancelled.");
|
|
257485
257358
|
throw new CLIExitError(0);
|
|
257486
257359
|
}
|
|
257487
|
-
const resolvedPath =
|
|
257360
|
+
const resolvedPath = resolve11(selectedPath);
|
|
257488
257361
|
await runTask2("Downloading your project's code...", async (updateMessage) => {
|
|
257489
257362
|
await createProjectFilesForExistingProject({
|
|
257490
257363
|
projectId,
|
|
@@ -257542,7 +257415,6 @@ function createProgram(context) {
|
|
|
257542
257415
|
program2.addCommand(getWhoamiCommand());
|
|
257543
257416
|
program2.addCommand(getLogoutCommand());
|
|
257544
257417
|
program2.addCommand(getCreateCommand());
|
|
257545
|
-
program2.addCommand(getInitCommand());
|
|
257546
257418
|
program2.addCommand(getDashboardCommand());
|
|
257547
257419
|
program2.addCommand(getDeployCommand2());
|
|
257548
257420
|
program2.addCommand(getLinkCommand());
|
|
@@ -259853,14 +259725,14 @@ async function addSourceContext(frames) {
|
|
|
259853
259725
|
return frames;
|
|
259854
259726
|
}
|
|
259855
259727
|
function getContextLinesFromFile(path19, ranges, output) {
|
|
259856
|
-
return new Promise((
|
|
259728
|
+
return new Promise((resolve12) => {
|
|
259857
259729
|
const stream = createReadStream2(path19);
|
|
259858
259730
|
const lineReaded = createInterface2({
|
|
259859
259731
|
input: stream
|
|
259860
259732
|
});
|
|
259861
259733
|
function destroyStreamAndResolve() {
|
|
259862
259734
|
stream.destroy();
|
|
259863
|
-
|
|
259735
|
+
resolve12();
|
|
259864
259736
|
}
|
|
259865
259737
|
let lineNumber = 0;
|
|
259866
259738
|
let currentRangeIndex = 0;
|
|
@@ -260972,15 +260844,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
260972
260844
|
return true;
|
|
260973
260845
|
if (this.featureFlagsPoller === undefined)
|
|
260974
260846
|
return false;
|
|
260975
|
-
return new Promise((
|
|
260847
|
+
return new Promise((resolve12) => {
|
|
260976
260848
|
const timeout3 = setTimeout(() => {
|
|
260977
260849
|
cleanup();
|
|
260978
|
-
|
|
260850
|
+
resolve12(false);
|
|
260979
260851
|
}, timeoutMs);
|
|
260980
260852
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
|
|
260981
260853
|
clearTimeout(timeout3);
|
|
260982
260854
|
cleanup();
|
|
260983
|
-
|
|
260855
|
+
resolve12(count2 > 0);
|
|
260984
260856
|
});
|
|
260985
260857
|
});
|
|
260986
260858
|
}
|
|
@@ -261803,4 +261675,4 @@ export {
|
|
|
261803
261675
|
CLIExitError
|
|
261804
261676
|
};
|
|
261805
261677
|
|
|
261806
|
-
//# debugId=
|
|
261678
|
+
//# debugId=56D14727C0A146FB64756E2164756E21
|