@base44-preview/cli 0.0.38-pr.357.643fc18 → 0.0.38-pr.362.72930b8
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 +80 -207
- package/dist/cli/index.js.map +7 -8
- package/package.json +2 -1
- package/dist/deno-runtime/exec.ts +0 -55
package/dist/cli/index.js
CHANGED
|
@@ -164408,8 +164408,8 @@ var require_executor = __commonJS((exports, module) => {
|
|
|
164408
164408
|
}
|
|
164409
164409
|
resetBuffer() {
|
|
164410
164410
|
this.buffer = new Waterfall;
|
|
164411
|
-
this.buffer.chain(new Promise((
|
|
164412
|
-
this._triggerBuffer =
|
|
164411
|
+
this.buffer.chain(new Promise((resolve6) => {
|
|
164412
|
+
this._triggerBuffer = resolve6;
|
|
164413
164413
|
}));
|
|
164414
164414
|
if (this.ready)
|
|
164415
164415
|
this._triggerBuffer();
|
|
@@ -165429,7 +165429,7 @@ var require_storage = __commonJS((exports, module) => {
|
|
|
165429
165429
|
throw e8;
|
|
165430
165430
|
}
|
|
165431
165431
|
};
|
|
165432
|
-
var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((
|
|
165432
|
+
var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((resolve6, reject) => {
|
|
165433
165433
|
try {
|
|
165434
165434
|
const stream = writeFileStream(filename, { mode });
|
|
165435
165435
|
const readable2 = Readable6.from(lines);
|
|
@@ -165446,7 +165446,7 @@ var require_storage = __commonJS((exports, module) => {
|
|
|
165446
165446
|
if (err)
|
|
165447
165447
|
reject(err);
|
|
165448
165448
|
else
|
|
165449
|
-
|
|
165449
|
+
resolve6();
|
|
165450
165450
|
});
|
|
165451
165451
|
});
|
|
165452
165452
|
readable2.on("error", (err) => {
|
|
@@ -165617,7 +165617,7 @@ var require_persistence = __commonJS((exports, module) => {
|
|
|
165617
165617
|
return { data: tdata, indexes };
|
|
165618
165618
|
}
|
|
165619
165619
|
treatRawStreamAsync(rawStream) {
|
|
165620
|
-
return new Promise((
|
|
165620
|
+
return new Promise((resolve6, reject) => {
|
|
165621
165621
|
const dataById = {};
|
|
165622
165622
|
const indexes = {};
|
|
165623
165623
|
let corruptItems = 0;
|
|
@@ -165660,7 +165660,7 @@ var require_persistence = __commonJS((exports, module) => {
|
|
|
165660
165660
|
}
|
|
165661
165661
|
}
|
|
165662
165662
|
const data = Object.values(dataById);
|
|
165663
|
-
|
|
165663
|
+
resolve6({ data, indexes });
|
|
165664
165664
|
});
|
|
165665
165665
|
lineStream.on("error", function(err) {
|
|
165666
165666
|
reject(err, null);
|
|
@@ -191271,13 +191271,13 @@ var require_broadcast_operator = __commonJS((exports) => {
|
|
|
191271
191271
|
return true;
|
|
191272
191272
|
}
|
|
191273
191273
|
emitWithAck(ev2, ...args) {
|
|
191274
|
-
return new Promise((
|
|
191274
|
+
return new Promise((resolve6, reject) => {
|
|
191275
191275
|
args.push((err, responses) => {
|
|
191276
191276
|
if (err) {
|
|
191277
191277
|
err.responses = responses;
|
|
191278
191278
|
return reject(err);
|
|
191279
191279
|
} else {
|
|
191280
|
-
return
|
|
191280
|
+
return resolve6(responses);
|
|
191281
191281
|
}
|
|
191282
191282
|
});
|
|
191283
191283
|
this.emit(ev2, ...args);
|
|
@@ -191465,12 +191465,12 @@ var require_socket2 = __commonJS((exports) => {
|
|
|
191465
191465
|
}
|
|
191466
191466
|
emitWithAck(ev2, ...args) {
|
|
191467
191467
|
const withErr = this.flags.timeout !== undefined;
|
|
191468
|
-
return new Promise((
|
|
191468
|
+
return new Promise((resolve6, reject) => {
|
|
191469
191469
|
args.push((arg1, arg2) => {
|
|
191470
191470
|
if (withErr) {
|
|
191471
|
-
return arg1 ? reject(arg1) :
|
|
191471
|
+
return arg1 ? reject(arg1) : resolve6(arg2);
|
|
191472
191472
|
} else {
|
|
191473
|
-
return
|
|
191473
|
+
return resolve6(arg1);
|
|
191474
191474
|
}
|
|
191475
191475
|
});
|
|
191476
191476
|
this.emit(ev2, ...args);
|
|
@@ -191925,13 +191925,13 @@ var require_namespace = __commonJS((exports) => {
|
|
|
191925
191925
|
return true;
|
|
191926
191926
|
}
|
|
191927
191927
|
serverSideEmitWithAck(ev2, ...args) {
|
|
191928
|
-
return new Promise((
|
|
191928
|
+
return new Promise((resolve6, reject) => {
|
|
191929
191929
|
args.push((err, responses) => {
|
|
191930
191930
|
if (err) {
|
|
191931
191931
|
err.responses = responses;
|
|
191932
191932
|
return reject(err);
|
|
191933
191933
|
} else {
|
|
191934
|
-
return
|
|
191934
|
+
return resolve6(responses);
|
|
191935
191935
|
}
|
|
191936
191936
|
});
|
|
191937
191937
|
this.serverSideEmit(ev2, ...args);
|
|
@@ -192615,7 +192615,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
192615
192615
|
return localSockets;
|
|
192616
192616
|
}
|
|
192617
192617
|
const requestId = randomId();
|
|
192618
|
-
return new Promise((
|
|
192618
|
+
return new Promise((resolve6, reject) => {
|
|
192619
192619
|
const timeout3 = setTimeout(() => {
|
|
192620
192620
|
const storedRequest2 = this.requests.get(requestId);
|
|
192621
192621
|
if (storedRequest2) {
|
|
@@ -192625,7 +192625,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
192625
192625
|
}, opts.flags.timeout || DEFAULT_TIMEOUT);
|
|
192626
192626
|
const storedRequest = {
|
|
192627
192627
|
type: MessageType.FETCH_SOCKETS,
|
|
192628
|
-
resolve:
|
|
192628
|
+
resolve: resolve6,
|
|
192629
192629
|
timeout: timeout3,
|
|
192630
192630
|
current: 0,
|
|
192631
192631
|
expected: expectedResponseCount,
|
|
@@ -192835,7 +192835,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
192835
192835
|
return localSockets;
|
|
192836
192836
|
}
|
|
192837
192837
|
const requestId = randomId();
|
|
192838
|
-
return new Promise((
|
|
192838
|
+
return new Promise((resolve6, reject) => {
|
|
192839
192839
|
const timeout3 = setTimeout(() => {
|
|
192840
192840
|
const storedRequest2 = this.customRequests.get(requestId);
|
|
192841
192841
|
if (storedRequest2) {
|
|
@@ -192845,7 +192845,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
192845
192845
|
}, opts.flags.timeout || DEFAULT_TIMEOUT);
|
|
192846
192846
|
const storedRequest = {
|
|
192847
192847
|
type: MessageType.FETCH_SOCKETS,
|
|
192848
|
-
resolve:
|
|
192848
|
+
resolve: resolve6,
|
|
192849
192849
|
timeout: timeout3,
|
|
192850
192850
|
missingUids: new Set([...this.nodesMap.keys()]),
|
|
192851
192851
|
responses: localSockets
|
|
@@ -193574,13 +193574,13 @@ var require_dist4 = __commonJS((exports, module) => {
|
|
|
193574
193574
|
this.engine.close();
|
|
193575
193575
|
(0, uws_1.restoreAdapter)();
|
|
193576
193576
|
if (this.httpServer) {
|
|
193577
|
-
return new Promise((
|
|
193577
|
+
return new Promise((resolve6) => {
|
|
193578
193578
|
this.httpServer.close((err) => {
|
|
193579
193579
|
fn9 && fn9(err);
|
|
193580
193580
|
if (err) {
|
|
193581
193581
|
debug("server was not running");
|
|
193582
193582
|
}
|
|
193583
|
-
|
|
193583
|
+
resolve6();
|
|
193584
193584
|
});
|
|
193585
193585
|
});
|
|
193586
193586
|
} else {
|
|
@@ -208299,14 +208299,14 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
208299
208299
|
};
|
|
208300
208300
|
}
|
|
208301
208301
|
function readAndResolve(iter) {
|
|
208302
|
-
var
|
|
208303
|
-
if (
|
|
208302
|
+
var resolve6 = iter[kLastResolve];
|
|
208303
|
+
if (resolve6 !== null) {
|
|
208304
208304
|
var data = iter[kStream].read();
|
|
208305
208305
|
if (data !== null) {
|
|
208306
208306
|
iter[kLastPromise] = null;
|
|
208307
208307
|
iter[kLastResolve] = null;
|
|
208308
208308
|
iter[kLastReject] = null;
|
|
208309
|
-
|
|
208309
|
+
resolve6(createIterResult(data, false));
|
|
208310
208310
|
}
|
|
208311
208311
|
}
|
|
208312
208312
|
}
|
|
@@ -208314,13 +208314,13 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
208314
208314
|
process.nextTick(readAndResolve, iter);
|
|
208315
208315
|
}
|
|
208316
208316
|
function wrapForNext(lastPromise, iter) {
|
|
208317
|
-
return function(
|
|
208317
|
+
return function(resolve6, reject) {
|
|
208318
208318
|
lastPromise.then(function() {
|
|
208319
208319
|
if (iter[kEnded]) {
|
|
208320
|
-
|
|
208320
|
+
resolve6(createIterResult(undefined, true));
|
|
208321
208321
|
return;
|
|
208322
208322
|
}
|
|
208323
|
-
iter[kHandlePromise](
|
|
208323
|
+
iter[kHandlePromise](resolve6, reject);
|
|
208324
208324
|
}, reject);
|
|
208325
208325
|
};
|
|
208326
208326
|
}
|
|
@@ -208339,12 +208339,12 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
208339
208339
|
return Promise.resolve(createIterResult(undefined, true));
|
|
208340
208340
|
}
|
|
208341
208341
|
if (this[kStream].destroyed) {
|
|
208342
|
-
return new Promise(function(
|
|
208342
|
+
return new Promise(function(resolve6, reject) {
|
|
208343
208343
|
process.nextTick(function() {
|
|
208344
208344
|
if (_this[kError]) {
|
|
208345
208345
|
reject(_this[kError]);
|
|
208346
208346
|
} else {
|
|
208347
|
-
|
|
208347
|
+
resolve6(createIterResult(undefined, true));
|
|
208348
208348
|
}
|
|
208349
208349
|
});
|
|
208350
208350
|
});
|
|
@@ -208367,13 +208367,13 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
208367
208367
|
return this;
|
|
208368
208368
|
}), _defineProperty(_Object$setPrototypeO, "return", function _return() {
|
|
208369
208369
|
var _this2 = this;
|
|
208370
|
-
return new Promise(function(
|
|
208370
|
+
return new Promise(function(resolve6, reject) {
|
|
208371
208371
|
_this2[kStream].destroy(null, function(err) {
|
|
208372
208372
|
if (err) {
|
|
208373
208373
|
reject(err);
|
|
208374
208374
|
return;
|
|
208375
208375
|
}
|
|
208376
|
-
|
|
208376
|
+
resolve6(createIterResult(undefined, true));
|
|
208377
208377
|
});
|
|
208378
208378
|
});
|
|
208379
208379
|
}), _Object$setPrototypeO), AsyncIteratorPrototype);
|
|
@@ -208395,15 +208395,15 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
208395
208395
|
value: stream._readableState.endEmitted,
|
|
208396
208396
|
writable: true
|
|
208397
208397
|
}), _defineProperty(_Object$create, kHandlePromise, {
|
|
208398
|
-
value: function value(
|
|
208398
|
+
value: function value(resolve6, reject) {
|
|
208399
208399
|
var data = iterator[kStream].read();
|
|
208400
208400
|
if (data) {
|
|
208401
208401
|
iterator[kLastPromise] = null;
|
|
208402
208402
|
iterator[kLastResolve] = null;
|
|
208403
208403
|
iterator[kLastReject] = null;
|
|
208404
|
-
|
|
208404
|
+
resolve6(createIterResult(data, false));
|
|
208405
208405
|
} else {
|
|
208406
|
-
iterator[kLastResolve] =
|
|
208406
|
+
iterator[kLastResolve] = resolve6;
|
|
208407
208407
|
iterator[kLastReject] = reject;
|
|
208408
208408
|
}
|
|
208409
208409
|
},
|
|
@@ -208422,12 +208422,12 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
208422
208422
|
iterator[kError] = err;
|
|
208423
208423
|
return;
|
|
208424
208424
|
}
|
|
208425
|
-
var
|
|
208426
|
-
if (
|
|
208425
|
+
var resolve6 = iterator[kLastResolve];
|
|
208426
|
+
if (resolve6 !== null) {
|
|
208427
208427
|
iterator[kLastPromise] = null;
|
|
208428
208428
|
iterator[kLastResolve] = null;
|
|
208429
208429
|
iterator[kLastReject] = null;
|
|
208430
|
-
|
|
208430
|
+
resolve6(createIterResult(undefined, true));
|
|
208431
208431
|
}
|
|
208432
208432
|
iterator[kEnded] = true;
|
|
208433
208433
|
});
|
|
@@ -208439,7 +208439,7 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
208439
208439
|
|
|
208440
208440
|
// node_modules/readable-stream/lib/internal/streams/from.js
|
|
208441
208441
|
var require_from = __commonJS((exports, module) => {
|
|
208442
|
-
function asyncGeneratorStep(gen,
|
|
208442
|
+
function asyncGeneratorStep(gen, resolve6, reject, _next, _throw, key2, arg) {
|
|
208443
208443
|
try {
|
|
208444
208444
|
var info = gen[key2](arg);
|
|
208445
208445
|
var value = info.value;
|
|
@@ -208448,7 +208448,7 @@ var require_from = __commonJS((exports, module) => {
|
|
|
208448
208448
|
return;
|
|
208449
208449
|
}
|
|
208450
208450
|
if (info.done) {
|
|
208451
|
-
|
|
208451
|
+
resolve6(value);
|
|
208452
208452
|
} else {
|
|
208453
208453
|
Promise.resolve(value).then(_next, _throw);
|
|
208454
208454
|
}
|
|
@@ -208456,13 +208456,13 @@ var require_from = __commonJS((exports, module) => {
|
|
|
208456
208456
|
function _asyncToGenerator(fn9) {
|
|
208457
208457
|
return function() {
|
|
208458
208458
|
var self2 = this, args = arguments;
|
|
208459
|
-
return new Promise(function(
|
|
208459
|
+
return new Promise(function(resolve6, reject) {
|
|
208460
208460
|
var gen = fn9.apply(self2, args);
|
|
208461
208461
|
function _next(value) {
|
|
208462
|
-
asyncGeneratorStep(gen,
|
|
208462
|
+
asyncGeneratorStep(gen, resolve6, reject, _next, _throw, "next", value);
|
|
208463
208463
|
}
|
|
208464
208464
|
function _throw(err) {
|
|
208465
|
-
asyncGeneratorStep(gen,
|
|
208465
|
+
asyncGeneratorStep(gen, resolve6, reject, _next, _throw, "throw", err);
|
|
208466
208466
|
}
|
|
208467
208467
|
_next(undefined);
|
|
208468
208468
|
});
|
|
@@ -210590,7 +210590,7 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
210590
210590
|
});
|
|
210591
210591
|
module.exports = __toCommonJS(src_exports);
|
|
210592
210592
|
var import_promises22 = __require("node:fs/promises");
|
|
210593
|
-
var
|
|
210593
|
+
var import_node_fs21 = __require("node:fs");
|
|
210594
210594
|
var DEVIN_LOCAL_PATH = "/opt/.devin";
|
|
210595
210595
|
var CURSOR2 = "cursor";
|
|
210596
210596
|
var CURSOR_CLI = "cursor-cli";
|
|
@@ -210647,7 +210647,7 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
210647
210647
|
return { isAgent: true, agent: { name: REPLIT } };
|
|
210648
210648
|
}
|
|
210649
210649
|
try {
|
|
210650
|
-
await (0, import_promises22.access)(DEVIN_LOCAL_PATH,
|
|
210650
|
+
await (0, import_promises22.access)(DEVIN_LOCAL_PATH, import_node_fs21.constants.F_OK);
|
|
210651
210651
|
return { isAgent: true, agent: { name: DEVIN } };
|
|
210652
210652
|
} catch (error48) {}
|
|
210653
210653
|
return { isAgent: false, agent: undefined };
|
|
@@ -226140,6 +226140,12 @@ import { homedir } from "node:os";
|
|
|
226140
226140
|
import { dirname, join } from "node:path";
|
|
226141
226141
|
import { fileURLToPath } from "node:url";
|
|
226142
226142
|
|
|
226143
|
+
// src/core/assets.ts
|
|
226144
|
+
var assetsDir;
|
|
226145
|
+
function getAssetsDir() {
|
|
226146
|
+
return assetsDir;
|
|
226147
|
+
}
|
|
226148
|
+
|
|
226143
226149
|
// src/core/consts.ts
|
|
226144
226150
|
var PROJECT_SUBDIR = "base44";
|
|
226145
226151
|
var CONFIG_FILE_EXTENSION = "jsonc";
|
|
@@ -226218,6 +226224,9 @@ function getAuthFilePath() {
|
|
|
226218
226224
|
return join(getBase44GlobalDir(), "auth", "auth.json");
|
|
226219
226225
|
}
|
|
226220
226226
|
function getTemplatesDir() {
|
|
226227
|
+
const assets = getAssetsDir();
|
|
226228
|
+
if (assets)
|
|
226229
|
+
return join(assets, "templates");
|
|
226221
226230
|
return join(__dirname2, "../templates");
|
|
226222
226231
|
}
|
|
226223
226232
|
function getTemplatesIndexPath() {
|
|
@@ -241958,6 +241967,7 @@ var package_default = {
|
|
|
241958
241967
|
"lint:fix": "biome check --write src tests",
|
|
241959
241968
|
test: "vitest run",
|
|
241960
241969
|
"test:watch": "vitest",
|
|
241970
|
+
"build:binaries": "bun run infra/build-binaries.ts",
|
|
241961
241971
|
knip: "knip",
|
|
241962
241972
|
"knip:fix": "knip --fix"
|
|
241963
241973
|
},
|
|
@@ -244066,7 +244076,6 @@ var { promisify: promisify11 } = __require("util");
|
|
|
244066
244076
|
var tmp = require_tmp();
|
|
244067
244077
|
var $fileSync = tmp.fileSync;
|
|
244068
244078
|
var fileWithOptions = promisify11((options8, cb2) => tmp.file(options8, (err, path18, fd, cleanup) => err ? cb2(err) : cb2(undefined, { path: path18, fd, cleanup: promisify11(cleanup) })));
|
|
244069
|
-
var $file = async (options8) => fileWithOptions(options8);
|
|
244070
244079
|
var $dirSync = tmp.dirSync;
|
|
244071
244080
|
var dirWithOptions = promisify11((options8, cb2) => tmp.dir(options8, (err, path18, cleanup) => err ? cb2(err) : cb2(undefined, { path: path18, cleanup: promisify11(cleanup) })));
|
|
244072
244081
|
var $dir = async (options8) => dirWithOptions(options8);
|
|
@@ -244099,89 +244108,11 @@ function createDevLogger() {
|
|
|
244099
244108
|
}
|
|
244100
244109
|
|
|
244101
244110
|
// src/cli/dev/dev-server/function-manager.ts
|
|
244102
|
-
import { spawn as
|
|
244111
|
+
import { spawn as spawn2, spawnSync as spawnSync2 } from "node:child_process";
|
|
244103
244112
|
import { dirname as dirname12, join as join15 } from "node:path";
|
|
244104
244113
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
244105
|
-
|
|
244106
|
-
// src/core/exec/run-script.ts
|
|
244107
|
-
import { spawn as spawn2, spawnSync as spawnSync2 } from "node:child_process";
|
|
244108
|
-
import { copyFileSync, writeFileSync as writeFileSync2 } from "node:fs";
|
|
244109
|
-
import { resolve as resolve6 } from "node:path";
|
|
244110
|
-
function verifyDenoInstalled() {
|
|
244111
|
-
const result = spawnSync2("deno", ["--version"]);
|
|
244112
|
-
if (result.error) {
|
|
244113
|
-
throw new DependencyNotFoundError("Deno is required to run scripts with exec", {
|
|
244114
|
-
hints: [
|
|
244115
|
-
{
|
|
244116
|
-
message: "Install Deno: https://docs.deno.com/runtime/getting_started/installation/"
|
|
244117
|
-
}
|
|
244118
|
-
]
|
|
244119
|
-
});
|
|
244120
|
-
}
|
|
244121
|
-
}
|
|
244122
|
-
async function getUserAppToken() {
|
|
244123
|
-
try {
|
|
244124
|
-
const response = await getAppClient().get("auth/token").json();
|
|
244125
|
-
return response.token;
|
|
244126
|
-
} catch (error48) {
|
|
244127
|
-
throw await ApiError.fromHttpError(error48, "exchanging platform token for app user token");
|
|
244128
|
-
}
|
|
244129
|
-
}
|
|
244130
|
-
async function runScript(options8) {
|
|
244131
|
-
const { filePath, code: code2, extraArgs = [], execWrapperPath } = options8;
|
|
244132
|
-
verifyDenoInstalled();
|
|
244133
|
-
const cleanupFns = [];
|
|
244134
|
-
let scriptPath;
|
|
244135
|
-
if (filePath) {
|
|
244136
|
-
scriptPath = `file://${resolve6(filePath)}`;
|
|
244137
|
-
} else if (code2 !== undefined) {
|
|
244138
|
-
const tempScript = await $file({ postfix: ".ts" });
|
|
244139
|
-
cleanupFns.push(tempScript.cleanup);
|
|
244140
|
-
writeFileSync2(tempScript.path, code2, "utf-8");
|
|
244141
|
-
scriptPath = `file://${tempScript.path}`;
|
|
244142
|
-
} else {
|
|
244143
|
-
throw new Error("Either filePath or code must be provided");
|
|
244144
|
-
}
|
|
244145
|
-
const appConfig = getAppConfig();
|
|
244146
|
-
const [appUserToken, appBaseUrl] = await Promise.all([
|
|
244147
|
-
getUserAppToken(),
|
|
244148
|
-
getSiteUrl()
|
|
244149
|
-
]);
|
|
244150
|
-
const tempWrapper = await $file({ postfix: ".ts" });
|
|
244151
|
-
cleanupFns.push(tempWrapper.cleanup);
|
|
244152
|
-
copyFileSync(execWrapperPath, tempWrapper.path);
|
|
244153
|
-
try {
|
|
244154
|
-
const exitCode = await new Promise((resolvePromise) => {
|
|
244155
|
-
const child = spawn2("deno", [
|
|
244156
|
-
"run",
|
|
244157
|
-
"--allow-all",
|
|
244158
|
-
"--node-modules-dir=auto",
|
|
244159
|
-
tempWrapper.path,
|
|
244160
|
-
...extraArgs
|
|
244161
|
-
], {
|
|
244162
|
-
env: {
|
|
244163
|
-
...process.env,
|
|
244164
|
-
SCRIPT_PATH: scriptPath,
|
|
244165
|
-
BASE44_APP_ID: appConfig.id,
|
|
244166
|
-
BASE44_ACCESS_TOKEN: appUserToken,
|
|
244167
|
-
BASE44_APP_BASE_URL: appBaseUrl
|
|
244168
|
-
},
|
|
244169
|
-
stdio: "inherit"
|
|
244170
|
-
});
|
|
244171
|
-
child.on("close", (code3) => {
|
|
244172
|
-
resolvePromise(code3 ?? 1);
|
|
244173
|
-
});
|
|
244174
|
-
});
|
|
244175
|
-
return { exitCode };
|
|
244176
|
-
} finally {
|
|
244177
|
-
for (const cleanup of cleanupFns) {
|
|
244178
|
-
cleanup();
|
|
244179
|
-
}
|
|
244180
|
-
}
|
|
244181
|
-
}
|
|
244182
|
-
// src/cli/dev/dev-server/function-manager.ts
|
|
244183
244114
|
var __dirname5 = dirname12(fileURLToPath7(import.meta.url));
|
|
244184
|
-
var WRAPPER_PATH = join15(__dirname5, "../deno-runtime/main.js");
|
|
244115
|
+
var WRAPPER_PATH = getAssetsDir() ? join15(getAssetsDir(), "deno-runtime", "main.js") : join15(__dirname5, "../deno-runtime/main.js");
|
|
244185
244116
|
var READY_TIMEOUT = 30000;
|
|
244186
244117
|
|
|
244187
244118
|
class FunctionManager {
|
|
@@ -244193,7 +244124,15 @@ class FunctionManager {
|
|
|
244193
244124
|
this.functions = new Map(functions.map((f7) => [f7.name, f7]));
|
|
244194
244125
|
this.logger = logger;
|
|
244195
244126
|
if (functions.length > 0) {
|
|
244196
|
-
|
|
244127
|
+
this.verifyDenoIsInstalled();
|
|
244128
|
+
}
|
|
244129
|
+
}
|
|
244130
|
+
verifyDenoIsInstalled() {
|
|
244131
|
+
const result = spawnSync2("deno", ["--version"]);
|
|
244132
|
+
if (result.error) {
|
|
244133
|
+
throw new DependencyNotFoundError("Deno is required to run functions", {
|
|
244134
|
+
hints: [{ message: "Install Deno from https://deno.com/download" }]
|
|
244135
|
+
});
|
|
244197
244136
|
}
|
|
244198
244137
|
}
|
|
244199
244138
|
getFunctionNames() {
|
|
@@ -244256,7 +244195,7 @@ class FunctionManager {
|
|
|
244256
244195
|
}
|
|
244257
244196
|
spawnFunction(func, port) {
|
|
244258
244197
|
this.logger.log(`Spawning function "${func.name}" on port ${port}`);
|
|
244259
|
-
const process21 =
|
|
244198
|
+
const process21 = spawn2("deno", ["run", "--allow-all", WRAPPER_PATH], {
|
|
244260
244199
|
env: {
|
|
244261
244200
|
...globalThis.process.env,
|
|
244262
244201
|
FUNCTION_PATH: func.entryPath,
|
|
@@ -244294,7 +244233,7 @@ class FunctionManager {
|
|
|
244294
244233
|
});
|
|
244295
244234
|
}
|
|
244296
244235
|
waitForReady(name2, runningFunc) {
|
|
244297
|
-
return new Promise((
|
|
244236
|
+
return new Promise((resolve6, reject) => {
|
|
244298
244237
|
runningFunc.process.on("exit", (code2) => {
|
|
244299
244238
|
if (!runningFunc.ready) {
|
|
244300
244239
|
clearTimeout(timeout3);
|
|
@@ -244317,7 +244256,7 @@ class FunctionManager {
|
|
|
244317
244256
|
runningFunc.ready = true;
|
|
244318
244257
|
clearTimeout(timeout3);
|
|
244319
244258
|
runningFunc.process.stdout?.off("data", onData);
|
|
244320
|
-
|
|
244259
|
+
resolve6(runningFunc.port);
|
|
244321
244260
|
}
|
|
244322
244261
|
};
|
|
244323
244262
|
runningFunc.process.stdout?.on("data", onData);
|
|
@@ -245595,7 +245534,7 @@ class NodeFsHandler {
|
|
|
245595
245534
|
this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
|
|
245596
245535
|
}
|
|
245597
245536
|
}).on(EV.ERROR, this._boundHandleError);
|
|
245598
|
-
return new Promise((
|
|
245537
|
+
return new Promise((resolve7, reject) => {
|
|
245599
245538
|
if (!stream)
|
|
245600
245539
|
return reject();
|
|
245601
245540
|
stream.once(STR_END, () => {
|
|
@@ -245604,7 +245543,7 @@ class NodeFsHandler {
|
|
|
245604
245543
|
return;
|
|
245605
245544
|
}
|
|
245606
245545
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
245607
|
-
|
|
245546
|
+
resolve7(undefined);
|
|
245608
245547
|
previous.getChildren().filter((item) => {
|
|
245609
245548
|
return item !== directory && !current.has(item);
|
|
245610
245549
|
}).forEach((item) => {
|
|
@@ -246491,7 +246430,7 @@ async function createDevServer(options8) {
|
|
|
246491
246430
|
devLogger.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
|
|
246492
246431
|
remoteProxy(req, res, next);
|
|
246493
246432
|
});
|
|
246494
|
-
const server = await new Promise((
|
|
246433
|
+
const server = await new Promise((resolve8, reject) => {
|
|
246495
246434
|
const s5 = app.listen(port, "127.0.0.1", (err) => {
|
|
246496
246435
|
if (err) {
|
|
246497
246436
|
if ("code" in err && err.code === "EADDRINUSE") {
|
|
@@ -246500,7 +246439,7 @@ async function createDevServer(options8) {
|
|
|
246500
246439
|
reject(err);
|
|
246501
246440
|
}
|
|
246502
246441
|
} else {
|
|
246503
|
-
|
|
246442
|
+
resolve8(s5);
|
|
246504
246443
|
}
|
|
246505
246444
|
});
|
|
246506
246445
|
});
|
|
@@ -246573,73 +246512,8 @@ function getDevCommand(context) {
|
|
|
246573
246512
|
});
|
|
246574
246513
|
}
|
|
246575
246514
|
|
|
246576
|
-
// src/cli/commands/exec.ts
|
|
246577
|
-
import { dirname as dirname16, join as join19 } from "node:path";
|
|
246578
|
-
import { fileURLToPath as fileURLToPath8 } from "node:url";
|
|
246579
|
-
var __dirname6 = dirname16(fileURLToPath8(import.meta.url));
|
|
246580
|
-
var EXEC_WRAPPER_PATH = join19(__dirname6, "../deno-runtime/exec.ts");
|
|
246581
|
-
function readStdin() {
|
|
246582
|
-
return new Promise((resolve9, reject) => {
|
|
246583
|
-
let data = "";
|
|
246584
|
-
process.stdin.setEncoding("utf-8");
|
|
246585
|
-
process.stdin.on("data", (chunk) => {
|
|
246586
|
-
data += chunk;
|
|
246587
|
-
});
|
|
246588
|
-
process.stdin.on("end", () => resolve9(data));
|
|
246589
|
-
process.stdin.on("error", reject);
|
|
246590
|
-
});
|
|
246591
|
-
}
|
|
246592
|
-
function validateInput2(command) {
|
|
246593
|
-
const [scriptArg] = command.args;
|
|
246594
|
-
const { eval: evalCode } = command.opts();
|
|
246595
|
-
const hasStdin = scriptArg === "-";
|
|
246596
|
-
const hasFile = scriptArg !== undefined && !hasStdin;
|
|
246597
|
-
const hasEval = evalCode !== undefined;
|
|
246598
|
-
const inputCount = [hasFile, hasEval, hasStdin].filter(Boolean).length;
|
|
246599
|
-
if (inputCount > 1) {
|
|
246600
|
-
throw new InvalidInputError("Cannot use more than one input mode. Provide only one of: file path, -e, or -.");
|
|
246601
|
-
}
|
|
246602
|
-
if (inputCount === 0) {
|
|
246603
|
-
throw new InvalidInputError("No script provided. Pass a file path, use -e for inline code, or - for stdin.", {
|
|
246604
|
-
hints: [
|
|
246605
|
-
{ message: "File: base44 exec ./script.ts" },
|
|
246606
|
-
{ message: 'Eval: base44 exec -e "console.log(1)"' },
|
|
246607
|
-
{ message: "Stdin: echo 'code' | base44 exec -" }
|
|
246608
|
-
]
|
|
246609
|
-
});
|
|
246610
|
-
}
|
|
246611
|
-
}
|
|
246612
|
-
async function execAction(scriptArg, options8, extraArgs) {
|
|
246613
|
-
const hasStdin = scriptArg === "-";
|
|
246614
|
-
const hasFile = scriptArg !== undefined && !hasStdin;
|
|
246615
|
-
let code2;
|
|
246616
|
-
if (hasStdin) {
|
|
246617
|
-
code2 = await readStdin();
|
|
246618
|
-
} else if (options8.eval !== undefined) {
|
|
246619
|
-
code2 = options8.eval;
|
|
246620
|
-
}
|
|
246621
|
-
const { exitCode } = await runScript({
|
|
246622
|
-
filePath: hasFile ? scriptArg : undefined,
|
|
246623
|
-
code: code2,
|
|
246624
|
-
extraArgs,
|
|
246625
|
-
execWrapperPath: EXEC_WRAPPER_PATH
|
|
246626
|
-
});
|
|
246627
|
-
if (exitCode !== 0) {
|
|
246628
|
-
process.exitCode = exitCode;
|
|
246629
|
-
}
|
|
246630
|
-
return {};
|
|
246631
|
-
}
|
|
246632
|
-
function getExecCommand(context) {
|
|
246633
|
-
const cmd = new Command("exec").description("Run a script with the Base44 SDK pre-authenticated as the current user").argument("[script]", "Path to a .ts/.js file, or - for stdin").option("-e, --eval <code>", "Evaluate inline code").allowUnknownOption(true).hook("preAction", validateInput2).action(async (script, options8) => {
|
|
246634
|
-
const dashIndex = process.argv.indexOf("--");
|
|
246635
|
-
const extraArgs = dashIndex !== -1 ? process.argv.slice(dashIndex + 1) : [];
|
|
246636
|
-
await runCommand(() => execAction(script, options8, extraArgs), { requireAuth: true }, context);
|
|
246637
|
-
});
|
|
246638
|
-
return cmd;
|
|
246639
|
-
}
|
|
246640
|
-
|
|
246641
246515
|
// src/cli/commands/project/eject.ts
|
|
246642
|
-
import { resolve as
|
|
246516
|
+
import { resolve as resolve8 } from "node:path";
|
|
246643
246517
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
246644
246518
|
async function eject(options8) {
|
|
246645
246519
|
const projects = await listProjects();
|
|
@@ -246688,7 +246562,7 @@ async function eject(options8) {
|
|
|
246688
246562
|
Ne("Operation cancelled.");
|
|
246689
246563
|
throw new CLIExitError(0);
|
|
246690
246564
|
}
|
|
246691
|
-
const resolvedPath =
|
|
246565
|
+
const resolvedPath = resolve8(selectedPath);
|
|
246692
246566
|
await runTask("Downloading your project's code...", async (updateMessage) => {
|
|
246693
246567
|
await createProjectFilesForExistingProject({
|
|
246694
246568
|
projectId,
|
|
@@ -246754,7 +246628,6 @@ function createProgram(context) {
|
|
|
246754
246628
|
program2.addCommand(getSecretsCommand(context));
|
|
246755
246629
|
program2.addCommand(getSiteCommand(context));
|
|
246756
246630
|
program2.addCommand(getTypesCommand(context));
|
|
246757
|
-
program2.addCommand(getExecCommand(context));
|
|
246758
246631
|
program2.addCommand(getDevCommand(context), { hidden: true });
|
|
246759
246632
|
program2.addCommand(getLogsCommand(context), { hidden: true });
|
|
246760
246633
|
return program2;
|
|
@@ -246765,7 +246638,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
246765
246638
|
import { release, type } from "node:os";
|
|
246766
246639
|
|
|
246767
246640
|
// node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
246768
|
-
import { dirname as
|
|
246641
|
+
import { dirname as dirname16, posix, sep } from "path";
|
|
246769
246642
|
function createModulerModifier() {
|
|
246770
246643
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
246771
246644
|
return async (frames) => {
|
|
@@ -246774,7 +246647,7 @@ function createModulerModifier() {
|
|
|
246774
246647
|
return frames;
|
|
246775
246648
|
};
|
|
246776
246649
|
}
|
|
246777
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
246650
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname16(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
246778
246651
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
246779
246652
|
return (filename) => {
|
|
246780
246653
|
if (!filename)
|
|
@@ -249052,14 +248925,14 @@ async function addSourceContext(frames) {
|
|
|
249052
248925
|
return frames;
|
|
249053
248926
|
}
|
|
249054
248927
|
function getContextLinesFromFile(path19, ranges, output) {
|
|
249055
|
-
return new Promise((
|
|
248928
|
+
return new Promise((resolve9) => {
|
|
249056
248929
|
const stream = createReadStream2(path19);
|
|
249057
248930
|
const lineReaded = createInterface2({
|
|
249058
248931
|
input: stream
|
|
249059
248932
|
});
|
|
249060
248933
|
function destroyStreamAndResolve() {
|
|
249061
248934
|
stream.destroy();
|
|
249062
|
-
|
|
248935
|
+
resolve9();
|
|
249063
248936
|
}
|
|
249064
248937
|
let lineNumber = 0;
|
|
249065
248938
|
let currentRangeIndex = 0;
|
|
@@ -250171,15 +250044,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
250171
250044
|
return true;
|
|
250172
250045
|
if (this.featureFlagsPoller === undefined)
|
|
250173
250046
|
return false;
|
|
250174
|
-
return new Promise((
|
|
250047
|
+
return new Promise((resolve9) => {
|
|
250175
250048
|
const timeout3 = setTimeout(() => {
|
|
250176
250049
|
cleanup();
|
|
250177
|
-
|
|
250050
|
+
resolve9(false);
|
|
250178
250051
|
}, timeoutMs);
|
|
250179
250052
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
|
|
250180
250053
|
clearTimeout(timeout3);
|
|
250181
250054
|
cleanup();
|
|
250182
|
-
|
|
250055
|
+
resolve9(count2 > 0);
|
|
250183
250056
|
});
|
|
250184
250057
|
});
|
|
250185
250058
|
}
|
|
@@ -250992,4 +250865,4 @@ export {
|
|
|
250992
250865
|
CLIExitError
|
|
250993
250866
|
};
|
|
250994
250867
|
|
|
250995
|
-
//# debugId=
|
|
250868
|
+
//# debugId=16BBB389AA548E0B64756E2164756E21
|