@base44-preview/cli 0.0.54-pr.535.dfef860 → 0.0.54-pr.537.9854ec3
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 +121 -270
- package/dist/cli/index.js.map +6 -7
- 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
|
});
|
|
@@ -243975,15 +243975,13 @@ async function listTemplates() {
|
|
|
243975
243975
|
}
|
|
243976
243976
|
return result.data.templates;
|
|
243977
243977
|
}
|
|
243978
|
-
async function renderTemplate(template, destPath, data
|
|
243979
|
-
const { skipExisting = false } = options;
|
|
243978
|
+
async function renderTemplate(template, destPath, data) {
|
|
243980
243979
|
const templateDir = join12(getTemplatesDir(), template.path);
|
|
243981
243980
|
const files = await globby("**/*", {
|
|
243982
243981
|
cwd: templateDir,
|
|
243983
243982
|
dot: true,
|
|
243984
243983
|
onlyFiles: true
|
|
243985
243984
|
});
|
|
243986
|
-
const skipped = [];
|
|
243987
243985
|
for (const file2 of files) {
|
|
243988
243986
|
const srcPath = join12(templateDir, file2);
|
|
243989
243987
|
try {
|
|
@@ -243992,17 +243990,9 @@ async function renderTemplate(template, destPath, data, options = {}) {
|
|
|
243992
243990
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
243993
243991
|
const destFile = attributes.outputFileName ? join12(dirname7(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
243994
243992
|
const destFilePath = join12(destPath, destFile);
|
|
243995
|
-
if (skipExisting && await pathExists(destFilePath)) {
|
|
243996
|
-
skipped.push(destFile);
|
|
243997
|
-
continue;
|
|
243998
|
-
}
|
|
243999
243993
|
await writeFile(destFilePath, body);
|
|
244000
243994
|
} else {
|
|
244001
243995
|
const destFilePath = join12(destPath, file2);
|
|
244002
|
-
if (skipExisting && await pathExists(destFilePath)) {
|
|
244003
|
-
skipped.push(file2);
|
|
244004
|
-
continue;
|
|
244005
|
-
}
|
|
244006
243996
|
await copyFile(srcPath, destFilePath);
|
|
244007
243997
|
}
|
|
244008
243998
|
} catch (error48) {
|
|
@@ -244010,7 +244000,6 @@ async function renderTemplate(template, destPath, data, options = {}) {
|
|
|
244010
244000
|
throw new Error(`Failed to process template file "${file2}": ${message}`);
|
|
244011
244001
|
}
|
|
244012
244002
|
}
|
|
244013
|
-
return skipped;
|
|
244014
244003
|
}
|
|
244015
244004
|
|
|
244016
244005
|
// src/core/project/create.ts
|
|
@@ -244033,20 +244022,6 @@ async function createProjectFiles(options) {
|
|
|
244033
244022
|
projectDir: basePath
|
|
244034
244023
|
};
|
|
244035
244024
|
}
|
|
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
244025
|
async function createProjectFilesForExistingProject(options) {
|
|
244051
244026
|
const { projectId, projectPath } = options;
|
|
244052
244027
|
await assertProjectNotExists(projectPath);
|
|
@@ -253256,129 +253231,6 @@ function printStripeResult(r, log) {
|
|
|
253256
253231
|
log.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
|
|
253257
253232
|
}
|
|
253258
253233
|
|
|
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
253234
|
// src/cli/commands/project/link.ts
|
|
253383
253235
|
function validateNonInteractiveFlags2(command2) {
|
|
253384
253236
|
const { create: create4, name: name2, projectId } = command2.opts();
|
|
@@ -253691,7 +253543,7 @@ function getSecretsListCommand() {
|
|
|
253691
253543
|
}
|
|
253692
253544
|
|
|
253693
253545
|
// src/cli/commands/secrets/set.ts
|
|
253694
|
-
import { resolve as
|
|
253546
|
+
import { resolve as resolve6 } from "node:path";
|
|
253695
253547
|
function parseEntries(entries) {
|
|
253696
253548
|
const secrets = {};
|
|
253697
253549
|
for (const entry of entries) {
|
|
@@ -253722,7 +253574,7 @@ async function setSecretsAction({ log, runTask: runTask2 }, entries, options) {
|
|
|
253722
253574
|
validateInput(entries, options);
|
|
253723
253575
|
let secrets;
|
|
253724
253576
|
if (options.envFile) {
|
|
253725
|
-
secrets = await parseEnvFile(
|
|
253577
|
+
secrets = await parseEnvFile(resolve6(options.envFile));
|
|
253726
253578
|
if (Object.keys(secrets).length === 0) {
|
|
253727
253579
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
253728
253580
|
}
|
|
@@ -253751,7 +253603,7 @@ function getSecretsCommand() {
|
|
|
253751
253603
|
}
|
|
253752
253604
|
|
|
253753
253605
|
// src/cli/commands/site/deploy.ts
|
|
253754
|
-
import { resolve as
|
|
253606
|
+
import { resolve as resolve7 } from "node:path";
|
|
253755
253607
|
async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
253756
253608
|
if (isNonInteractive && !options.yes) {
|
|
253757
253609
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
@@ -253766,7 +253618,7 @@ async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
|
253766
253618
|
]
|
|
253767
253619
|
});
|
|
253768
253620
|
}
|
|
253769
|
-
const outputDir =
|
|
253621
|
+
const outputDir = resolve7(project2.root, project2.site.outputDirectory);
|
|
253770
253622
|
if (!options.yes) {
|
|
253771
253623
|
const shouldDeploy = await Re({
|
|
253772
253624
|
message: `Deploy site from ${project2.site.outputDirectory}?`
|
|
@@ -253971,14 +253823,14 @@ var getLocalHosts = () => {
|
|
|
253971
253823
|
}
|
|
253972
253824
|
return results;
|
|
253973
253825
|
};
|
|
253974
|
-
var checkAvailablePort = (options8) => new Promise((
|
|
253826
|
+
var checkAvailablePort = (options8) => new Promise((resolve9, reject) => {
|
|
253975
253827
|
const server = net.createServer();
|
|
253976
253828
|
server.unref();
|
|
253977
253829
|
server.on("error", reject);
|
|
253978
253830
|
server.listen(options8, () => {
|
|
253979
253831
|
const { port } = server.address();
|
|
253980
253832
|
server.close(() => {
|
|
253981
|
-
|
|
253833
|
+
resolve9(port);
|
|
253982
253834
|
});
|
|
253983
253835
|
});
|
|
253984
253836
|
});
|
|
@@ -254238,7 +254090,7 @@ class FunctionManager {
|
|
|
254238
254090
|
});
|
|
254239
254091
|
}
|
|
254240
254092
|
waitForReady(name2, runningFunc) {
|
|
254241
|
-
return new Promise((
|
|
254093
|
+
return new Promise((resolve9, reject) => {
|
|
254242
254094
|
runningFunc.process.on("exit", (code2) => {
|
|
254243
254095
|
if (!runningFunc.ready) {
|
|
254244
254096
|
clearTimeout(timeout3);
|
|
@@ -254261,7 +254113,7 @@ class FunctionManager {
|
|
|
254261
254113
|
runningFunc.ready = true;
|
|
254262
254114
|
clearTimeout(timeout3);
|
|
254263
254115
|
runningFunc.process.stdout?.off("data", onData);
|
|
254264
|
-
|
|
254116
|
+
resolve9(runningFunc.port);
|
|
254265
254117
|
}
|
|
254266
254118
|
};
|
|
254267
254119
|
runningFunc.process.stdout?.on("data", onData);
|
|
@@ -255640,10 +255492,10 @@ class ReaddirpStream extends Readable6 {
|
|
|
255640
255492
|
}
|
|
255641
255493
|
async _formatEntry(dirent, path19) {
|
|
255642
255494
|
let entry;
|
|
255643
|
-
const
|
|
255495
|
+
const basename4 = this._isDirent ? dirent.name : dirent;
|
|
255644
255496
|
try {
|
|
255645
|
-
const fullPath = presolve(pjoin(path19,
|
|
255646
|
-
entry = { path: prelative(this._root, fullPath), fullPath, basename:
|
|
255497
|
+
const fullPath = presolve(pjoin(path19, basename4));
|
|
255498
|
+
entry = { path: prelative(this._root, fullPath), fullPath, basename: basename4 };
|
|
255647
255499
|
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
255648
255500
|
} catch (err) {
|
|
255649
255501
|
this._onError(err);
|
|
@@ -256170,9 +256022,9 @@ class NodeFsHandler {
|
|
|
256170
256022
|
_watchWithNodeFs(path19, listener) {
|
|
256171
256023
|
const opts = this.fsw.options;
|
|
256172
256024
|
const directory = sp2.dirname(path19);
|
|
256173
|
-
const
|
|
256025
|
+
const basename5 = sp2.basename(path19);
|
|
256174
256026
|
const parent = this.fsw._getWatchedDir(directory);
|
|
256175
|
-
parent.add(
|
|
256027
|
+
parent.add(basename5);
|
|
256176
256028
|
const absolutePath = sp2.resolve(path19);
|
|
256177
256029
|
const options8 = {
|
|
256178
256030
|
persistent: opts.persistent
|
|
@@ -256182,7 +256034,7 @@ class NodeFsHandler {
|
|
|
256182
256034
|
let closer;
|
|
256183
256035
|
if (opts.usePolling) {
|
|
256184
256036
|
const enableBin = opts.interval !== opts.binaryInterval;
|
|
256185
|
-
options8.interval = enableBin && isBinaryPath(
|
|
256037
|
+
options8.interval = enableBin && isBinaryPath(basename5) ? opts.binaryInterval : opts.interval;
|
|
256186
256038
|
closer = setFsWatchFileListener(path19, absolutePath, options8, {
|
|
256187
256039
|
listener,
|
|
256188
256040
|
rawEmitter: this.fsw._emitRaw
|
|
@@ -256201,10 +256053,10 @@ class NodeFsHandler {
|
|
|
256201
256053
|
return;
|
|
256202
256054
|
}
|
|
256203
256055
|
const dirname18 = sp2.dirname(file2);
|
|
256204
|
-
const
|
|
256056
|
+
const basename5 = sp2.basename(file2);
|
|
256205
256057
|
const parent = this.fsw._getWatchedDir(dirname18);
|
|
256206
256058
|
let prevStats = stats;
|
|
256207
|
-
if (parent.has(
|
|
256059
|
+
if (parent.has(basename5))
|
|
256208
256060
|
return;
|
|
256209
256061
|
const listener = async (path19, newStats) => {
|
|
256210
256062
|
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5))
|
|
@@ -256229,9 +256081,9 @@ class NodeFsHandler {
|
|
|
256229
256081
|
prevStats = newStats2;
|
|
256230
256082
|
}
|
|
256231
256083
|
} catch (error48) {
|
|
256232
|
-
this.fsw._remove(dirname18,
|
|
256084
|
+
this.fsw._remove(dirname18, basename5);
|
|
256233
256085
|
}
|
|
256234
|
-
} else if (parent.has(
|
|
256086
|
+
} else if (parent.has(basename5)) {
|
|
256235
256087
|
const at13 = newStats.atimeMs;
|
|
256236
256088
|
const mt12 = newStats.mtimeMs;
|
|
256237
256089
|
if (!at13 || at13 <= mt12 || mt12 !== prevStats.mtimeMs) {
|
|
@@ -256318,7 +256170,7 @@ class NodeFsHandler {
|
|
|
256318
256170
|
this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
|
|
256319
256171
|
}
|
|
256320
256172
|
}).on(EV.ERROR, this._boundHandleError);
|
|
256321
|
-
return new Promise((
|
|
256173
|
+
return new Promise((resolve10, reject) => {
|
|
256322
256174
|
if (!stream)
|
|
256323
256175
|
return reject();
|
|
256324
256176
|
stream.once(STR_END, () => {
|
|
@@ -256327,7 +256179,7 @@ class NodeFsHandler {
|
|
|
256327
256179
|
return;
|
|
256328
256180
|
}
|
|
256329
256181
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
256330
|
-
|
|
256182
|
+
resolve10(undefined);
|
|
256331
256183
|
previous.getChildren().filter((item) => {
|
|
256332
256184
|
return item !== directory && !current.has(item);
|
|
256333
256185
|
}).forEach((item) => {
|
|
@@ -257238,7 +257090,7 @@ async function createDevServer(options8) {
|
|
|
257238
257090
|
}
|
|
257239
257091
|
remoteProxy(req, res, next);
|
|
257240
257092
|
});
|
|
257241
|
-
const server = await new Promise((
|
|
257093
|
+
const server = await new Promise((resolve11, reject) => {
|
|
257242
257094
|
const s5 = app.listen(port, "127.0.0.1", (err) => {
|
|
257243
257095
|
if (err) {
|
|
257244
257096
|
if ("code" in err && err.code === "EADDRINUSE") {
|
|
@@ -257247,7 +257099,7 @@ async function createDevServer(options8) {
|
|
|
257247
257099
|
reject(err);
|
|
257248
257100
|
}
|
|
257249
257101
|
} else {
|
|
257250
|
-
|
|
257102
|
+
resolve11(s5);
|
|
257251
257103
|
}
|
|
257252
257104
|
});
|
|
257253
257105
|
});
|
|
@@ -257383,13 +257235,13 @@ async function runScript(options8) {
|
|
|
257383
257235
|
}
|
|
257384
257236
|
// src/cli/commands/exec.ts
|
|
257385
257237
|
function readStdin2() {
|
|
257386
|
-
return new Promise((
|
|
257238
|
+
return new Promise((resolve11, reject) => {
|
|
257387
257239
|
let data = "";
|
|
257388
257240
|
process.stdin.setEncoding("utf-8");
|
|
257389
257241
|
process.stdin.on("data", (chunk) => {
|
|
257390
257242
|
data += chunk;
|
|
257391
257243
|
});
|
|
257392
|
-
process.stdin.on("end", () =>
|
|
257244
|
+
process.stdin.on("end", () => resolve11(data));
|
|
257393
257245
|
process.stdin.on("error", reject);
|
|
257394
257246
|
});
|
|
257395
257247
|
}
|
|
@@ -257428,7 +257280,7 @@ Examples:
|
|
|
257428
257280
|
}
|
|
257429
257281
|
|
|
257430
257282
|
// src/cli/commands/project/eject.ts
|
|
257431
|
-
import { resolve as
|
|
257283
|
+
import { resolve as resolve11 } from "node:path";
|
|
257432
257284
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
257433
257285
|
async function eject(ctx, options8) {
|
|
257434
257286
|
const { log, runTask: runTask2, isNonInteractive } = ctx;
|
|
@@ -257484,7 +257336,7 @@ async function eject(ctx, options8) {
|
|
|
257484
257336
|
Ne("Operation cancelled.");
|
|
257485
257337
|
throw new CLIExitError(0);
|
|
257486
257338
|
}
|
|
257487
|
-
const resolvedPath =
|
|
257339
|
+
const resolvedPath = resolve11(selectedPath);
|
|
257488
257340
|
await runTask2("Downloading your project's code...", async (updateMessage) => {
|
|
257489
257341
|
await createProjectFilesForExistingProject({
|
|
257490
257342
|
projectId,
|
|
@@ -257542,7 +257394,6 @@ function createProgram(context) {
|
|
|
257542
257394
|
program2.addCommand(getWhoamiCommand());
|
|
257543
257395
|
program2.addCommand(getLogoutCommand());
|
|
257544
257396
|
program2.addCommand(getCreateCommand());
|
|
257545
|
-
program2.addCommand(getInitCommand());
|
|
257546
257397
|
program2.addCommand(getDashboardCommand());
|
|
257547
257398
|
program2.addCommand(getDeployCommand2());
|
|
257548
257399
|
program2.addCommand(getLinkCommand());
|
|
@@ -259853,14 +259704,14 @@ async function addSourceContext(frames) {
|
|
|
259853
259704
|
return frames;
|
|
259854
259705
|
}
|
|
259855
259706
|
function getContextLinesFromFile(path19, ranges, output) {
|
|
259856
|
-
return new Promise((
|
|
259707
|
+
return new Promise((resolve12) => {
|
|
259857
259708
|
const stream = createReadStream2(path19);
|
|
259858
259709
|
const lineReaded = createInterface2({
|
|
259859
259710
|
input: stream
|
|
259860
259711
|
});
|
|
259861
259712
|
function destroyStreamAndResolve() {
|
|
259862
259713
|
stream.destroy();
|
|
259863
|
-
|
|
259714
|
+
resolve12();
|
|
259864
259715
|
}
|
|
259865
259716
|
let lineNumber = 0;
|
|
259866
259717
|
let currentRangeIndex = 0;
|
|
@@ -260972,15 +260823,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
260972
260823
|
return true;
|
|
260973
260824
|
if (this.featureFlagsPoller === undefined)
|
|
260974
260825
|
return false;
|
|
260975
|
-
return new Promise((
|
|
260826
|
+
return new Promise((resolve12) => {
|
|
260976
260827
|
const timeout3 = setTimeout(() => {
|
|
260977
260828
|
cleanup();
|
|
260978
|
-
|
|
260829
|
+
resolve12(false);
|
|
260979
260830
|
}, timeoutMs);
|
|
260980
260831
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
|
|
260981
260832
|
clearTimeout(timeout3);
|
|
260982
260833
|
cleanup();
|
|
260983
|
-
|
|
260834
|
+
resolve12(count2 > 0);
|
|
260984
260835
|
});
|
|
260985
260836
|
});
|
|
260986
260837
|
}
|
|
@@ -261803,4 +261654,4 @@ export {
|
|
|
261803
261654
|
CLIExitError
|
|
261804
261655
|
};
|
|
261805
261656
|
|
|
261806
|
-
//# debugId=
|
|
261657
|
+
//# debugId=41048BD9382DF3D064756E2164756E21
|