@base44-preview/cli 0.0.37-pr.357.f1ef2fd → 0.0.37-pr.361.3ccea0a
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 +14 -132
- package/dist/cli/index.js.map +5 -6
- package/package.json +1 -1
- package/dist/deno-runtime/exec.ts +0 -55
package/dist/cli/index.js
CHANGED
|
@@ -210244,7 +210244,7 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
210244
210244
|
});
|
|
210245
210245
|
module.exports = __toCommonJS(src_exports);
|
|
210246
210246
|
var import_promises19 = __require("node:fs/promises");
|
|
210247
|
-
var
|
|
210247
|
+
var import_node_fs19 = __require("node:fs");
|
|
210248
210248
|
var DEVIN_LOCAL_PATH = "/opt/.devin";
|
|
210249
210249
|
var CURSOR2 = "cursor";
|
|
210250
210250
|
var CURSOR_CLI = "cursor-cli";
|
|
@@ -210301,7 +210301,7 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
210301
210301
|
return { isAgent: true, agent: { name: REPLIT } };
|
|
210302
210302
|
}
|
|
210303
210303
|
try {
|
|
210304
|
-
await (0, import_promises19.access)(DEVIN_LOCAL_PATH,
|
|
210304
|
+
await (0, import_promises19.access)(DEVIN_LOCAL_PATH, import_node_fs19.constants.F_OK);
|
|
210305
210305
|
return { isAgent: true, agent: { name: DEVIN } };
|
|
210306
210306
|
} catch (error48) {}
|
|
210307
210307
|
return { isAgent: false, agent: undefined };
|
|
@@ -234212,7 +234212,8 @@ async function setSecrets(secrets) {
|
|
|
234212
234212
|
let response;
|
|
234213
234213
|
try {
|
|
234214
234214
|
response = await appClient.post("secrets", {
|
|
234215
|
-
json: secrets
|
|
234215
|
+
json: secrets,
|
|
234216
|
+
timeout: false
|
|
234216
234217
|
});
|
|
234217
234218
|
} catch (error48) {
|
|
234218
234219
|
throw await ApiError.fromHttpError(error48, "setting secrets");
|
|
@@ -244352,126 +244353,8 @@ function getDevCommand(context) {
|
|
|
244352
244353
|
});
|
|
244353
244354
|
}
|
|
244354
244355
|
|
|
244355
|
-
// src/cli/commands/exec.ts
|
|
244356
|
-
import { spawn as spawn3, spawnSync as spawnSync3 } from "node:child_process";
|
|
244357
|
-
import { copyFileSync, unlinkSync, writeFileSync as writeFileSync2 } from "node:fs";
|
|
244358
|
-
import { tmpdir as tmpdir2 } from "node:os";
|
|
244359
|
-
import { dirname as dirname12, join as join16, resolve as resolve6 } from "node:path";
|
|
244360
|
-
import { fileURLToPath as fileURLToPath8 } from "node:url";
|
|
244361
|
-
var __dirname6 = dirname12(fileURLToPath8(import.meta.url));
|
|
244362
|
-
var EXEC_WRAPPER_PATH = join16(__dirname6, "../deno-runtime/exec.ts");
|
|
244363
|
-
function verifyDenoIsInstalled() {
|
|
244364
|
-
const result = spawnSync3("deno", ["--version"]);
|
|
244365
|
-
if (result.error) {
|
|
244366
|
-
throw new DependencyNotFoundError("Deno is required to run scripts with exec", {
|
|
244367
|
-
hints: [
|
|
244368
|
-
{
|
|
244369
|
-
message: "Install Deno: https://docs.deno.com/runtime/getting_started/installation/"
|
|
244370
|
-
}
|
|
244371
|
-
]
|
|
244372
|
-
});
|
|
244373
|
-
}
|
|
244374
|
-
}
|
|
244375
|
-
function readStdin() {
|
|
244376
|
-
return new Promise((resolve7, reject) => {
|
|
244377
|
-
let data = "";
|
|
244378
|
-
process.stdin.setEncoding("utf-8");
|
|
244379
|
-
process.stdin.on("data", (chunk) => {
|
|
244380
|
-
data += chunk;
|
|
244381
|
-
});
|
|
244382
|
-
process.stdin.on("end", () => resolve7(data));
|
|
244383
|
-
process.stdin.on("error", reject);
|
|
244384
|
-
});
|
|
244385
|
-
}
|
|
244386
|
-
async function execAction(scriptArg, options8, extraArgs) {
|
|
244387
|
-
let scriptPath;
|
|
244388
|
-
let tempFile = null;
|
|
244389
|
-
const hasFile = scriptArg !== undefined;
|
|
244390
|
-
const hasEval = options8.eval !== undefined;
|
|
244391
|
-
const hasStdin = options8.stdin === true;
|
|
244392
|
-
const inputCount = [hasFile, hasEval, hasStdin].filter(Boolean).length;
|
|
244393
|
-
if (inputCount > 1) {
|
|
244394
|
-
throw new InvalidInputError("Cannot use more than one input mode. Provide only one of: file path, -e, or --stdin.");
|
|
244395
|
-
}
|
|
244396
|
-
if (inputCount === 0) {
|
|
244397
|
-
throw new InvalidInputError("No script provided. Pass a file path, use -e for inline code, or use --stdin.", {
|
|
244398
|
-
hints: [
|
|
244399
|
-
{ message: "File: base44 exec ./script.ts" },
|
|
244400
|
-
{ message: 'Eval: base44 exec -e "console.log(1)"' },
|
|
244401
|
-
{ message: "Stdin: echo 'code' | base44 exec --stdin" }
|
|
244402
|
-
]
|
|
244403
|
-
});
|
|
244404
|
-
}
|
|
244405
|
-
verifyDenoIsInstalled();
|
|
244406
|
-
if (hasFile) {
|
|
244407
|
-
scriptPath = `file://${resolve6(scriptArg)}`;
|
|
244408
|
-
} else {
|
|
244409
|
-
const code2 = hasEval ? options8.eval : await readStdin();
|
|
244410
|
-
tempFile = join16(tmpdir2(), `base44-exec-${Date.now()}.ts`);
|
|
244411
|
-
writeFileSync2(tempFile, code2, "utf-8");
|
|
244412
|
-
scriptPath = `file://${tempFile}`;
|
|
244413
|
-
}
|
|
244414
|
-
const appConfig = getAppConfig();
|
|
244415
|
-
const [appUserToken, appBaseUrl] = await Promise.all([
|
|
244416
|
-
(async () => {
|
|
244417
|
-
try {
|
|
244418
|
-
const response = await getAppClient().get("auth/token").json();
|
|
244419
|
-
return response.token;
|
|
244420
|
-
} catch (error48) {
|
|
244421
|
-
throw await ApiError.fromHttpError(error48, "exchanging platform token for app user token");
|
|
244422
|
-
}
|
|
244423
|
-
})(),
|
|
244424
|
-
getSiteUrl()
|
|
244425
|
-
]);
|
|
244426
|
-
const tempWrapper = join16(tmpdir2(), `base44-exec-wrapper-${Date.now()}.ts`);
|
|
244427
|
-
copyFileSync(EXEC_WRAPPER_PATH, tempWrapper);
|
|
244428
|
-
try {
|
|
244429
|
-
const exitCode = await new Promise((resolvePromise) => {
|
|
244430
|
-
const child = spawn3("deno", [
|
|
244431
|
-
"run",
|
|
244432
|
-
"--allow-all",
|
|
244433
|
-
"--node-modules-dir=auto",
|
|
244434
|
-
tempWrapper,
|
|
244435
|
-
...extraArgs
|
|
244436
|
-
], {
|
|
244437
|
-
env: {
|
|
244438
|
-
...process.env,
|
|
244439
|
-
SCRIPT_PATH: scriptPath,
|
|
244440
|
-
BASE44_APP_ID: appConfig.id,
|
|
244441
|
-
BASE44_ACCESS_TOKEN: appUserToken,
|
|
244442
|
-
BASE44_APP_BASE_URL: appBaseUrl
|
|
244443
|
-
},
|
|
244444
|
-
stdio: "inherit"
|
|
244445
|
-
});
|
|
244446
|
-
child.on("close", (code2) => {
|
|
244447
|
-
resolvePromise(code2 ?? 1);
|
|
244448
|
-
});
|
|
244449
|
-
});
|
|
244450
|
-
if (exitCode !== 0) {
|
|
244451
|
-
process.exitCode = exitCode;
|
|
244452
|
-
}
|
|
244453
|
-
} finally {
|
|
244454
|
-
for (const f7 of [tempFile, tempWrapper]) {
|
|
244455
|
-
if (f7) {
|
|
244456
|
-
try {
|
|
244457
|
-
unlinkSync(f7);
|
|
244458
|
-
} catch {}
|
|
244459
|
-
}
|
|
244460
|
-
}
|
|
244461
|
-
}
|
|
244462
|
-
return {};
|
|
244463
|
-
}
|
|
244464
|
-
function getExecCommand(context) {
|
|
244465
|
-
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 or .js script file").option("-e, --eval <code>", "Evaluate inline code").option("--stdin", "Read script from stdin").allowUnknownOption(true).action(async (script, options8) => {
|
|
244466
|
-
const dashIndex = process.argv.indexOf("--");
|
|
244467
|
-
const extraArgs = dashIndex !== -1 ? process.argv.slice(dashIndex + 1) : [];
|
|
244468
|
-
await runCommand(() => execAction(script, options8, extraArgs), { requireAuth: true }, context);
|
|
244469
|
-
});
|
|
244470
|
-
return cmd;
|
|
244471
|
-
}
|
|
244472
|
-
|
|
244473
244356
|
// src/cli/commands/project/eject.ts
|
|
244474
|
-
import { resolve as
|
|
244357
|
+
import { resolve as resolve6 } from "node:path";
|
|
244475
244358
|
var import_lodash2 = __toESM(require_lodash(), 1);
|
|
244476
244359
|
async function eject(options8) {
|
|
244477
244360
|
const projects = await listProjects();
|
|
@@ -244520,7 +244403,7 @@ async function eject(options8) {
|
|
|
244520
244403
|
Ne("Operation cancelled.");
|
|
244521
244404
|
throw new CLIExitError(0);
|
|
244522
244405
|
}
|
|
244523
|
-
const resolvedPath =
|
|
244406
|
+
const resolvedPath = resolve6(selectedPath);
|
|
244524
244407
|
await runTask("Downloading your project's code...", async (updateMessage) => {
|
|
244525
244408
|
await createProjectFilesForExistingProject({
|
|
244526
244409
|
projectId,
|
|
@@ -244586,7 +244469,6 @@ function createProgram(context) {
|
|
|
244586
244469
|
program2.addCommand(getSecretsCommand(context));
|
|
244587
244470
|
program2.addCommand(getSiteCommand(context));
|
|
244588
244471
|
program2.addCommand(getTypesCommand(context));
|
|
244589
|
-
program2.addCommand(getExecCommand(context));
|
|
244590
244472
|
program2.addCommand(getDevCommand(context), { hidden: true });
|
|
244591
244473
|
program2.addCommand(getLogsCommand(context), { hidden: true });
|
|
244592
244474
|
return program2;
|
|
@@ -244597,7 +244479,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
244597
244479
|
import { release, type } from "node:os";
|
|
244598
244480
|
|
|
244599
244481
|
// node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
244600
|
-
import { dirname as
|
|
244482
|
+
import { dirname as dirname12, posix, sep } from "path";
|
|
244601
244483
|
function createModulerModifier() {
|
|
244602
244484
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
244603
244485
|
return async (frames) => {
|
|
@@ -244606,7 +244488,7 @@ function createModulerModifier() {
|
|
|
244606
244488
|
return frames;
|
|
244607
244489
|
};
|
|
244608
244490
|
}
|
|
244609
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
244491
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname12(process.argv[1]) : process.cwd(), isWindows4 = sep === "\\") {
|
|
244610
244492
|
const normalizedBase = isWindows4 ? normalizeWindowsPath2(basePath) : basePath;
|
|
244611
244493
|
return (filename) => {
|
|
244612
244494
|
if (!filename)
|
|
@@ -246884,14 +246766,14 @@ async function addSourceContext(frames) {
|
|
|
246884
246766
|
return frames;
|
|
246885
246767
|
}
|
|
246886
246768
|
function getContextLinesFromFile(path19, ranges, output) {
|
|
246887
|
-
return new Promise((
|
|
246769
|
+
return new Promise((resolve7) => {
|
|
246888
246770
|
const stream = createReadStream2(path19);
|
|
246889
246771
|
const lineReaded = createInterface2({
|
|
246890
246772
|
input: stream
|
|
246891
246773
|
});
|
|
246892
246774
|
function destroyStreamAndResolve() {
|
|
246893
246775
|
stream.destroy();
|
|
246894
|
-
|
|
246776
|
+
resolve7();
|
|
246895
246777
|
}
|
|
246896
246778
|
let lineNumber = 0;
|
|
246897
246779
|
let currentRangeIndex = 0;
|
|
@@ -248003,15 +247885,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
248003
247885
|
return true;
|
|
248004
247886
|
if (this.featureFlagsPoller === undefined)
|
|
248005
247887
|
return false;
|
|
248006
|
-
return new Promise((
|
|
247888
|
+
return new Promise((resolve7) => {
|
|
248007
247889
|
const timeout3 = setTimeout(() => {
|
|
248008
247890
|
cleanup();
|
|
248009
|
-
|
|
247891
|
+
resolve7(false);
|
|
248010
247892
|
}, timeoutMs);
|
|
248011
247893
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
|
|
248012
247894
|
clearTimeout(timeout3);
|
|
248013
247895
|
cleanup();
|
|
248014
|
-
|
|
247896
|
+
resolve7(count2 > 0);
|
|
248015
247897
|
});
|
|
248016
247898
|
});
|
|
248017
247899
|
}
|
|
@@ -248824,4 +248706,4 @@ export {
|
|
|
248824
248706
|
CLIExitError
|
|
248825
248707
|
};
|
|
248826
248708
|
|
|
248827
|
-
//# debugId=
|
|
248709
|
+
//# debugId=713CC237B538FE8F64756E2164756E21
|