@base44-preview/cli 0.0.45-pr.357.98cc75b → 0.0.45-pr.357.c6b2386
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 +42 -61
- package/dist/cli/index.js.map +10 -9
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -239630,20 +239630,6 @@ async function uploadSite(archivePath) {
|
|
|
239630
239630
|
}
|
|
239631
239631
|
return result.data;
|
|
239632
239632
|
}
|
|
239633
|
-
async function getSiteUrl(projectId) {
|
|
239634
|
-
const id = projectId ?? getAppConfig().id;
|
|
239635
|
-
let response;
|
|
239636
|
-
try {
|
|
239637
|
-
response = await base44Client.get(`api/apps/platform/${id}/published-url`);
|
|
239638
|
-
} catch (error48) {
|
|
239639
|
-
throw await ApiError.fromHttpError(error48, "fetching site URL");
|
|
239640
|
-
}
|
|
239641
|
-
const result = PublishedUrlResponseSchema.safeParse(await response.json());
|
|
239642
|
-
if (!result.success) {
|
|
239643
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
239644
|
-
}
|
|
239645
|
-
return result.data.url;
|
|
239646
|
-
}
|
|
239647
239633
|
// src/core/site/config.ts
|
|
239648
239634
|
async function getSiteFilePaths(outputDir) {
|
|
239649
239635
|
return await globby("**/*", {
|
|
@@ -246824,6 +246810,29 @@ async function deleteSecret(name2) {
|
|
|
246824
246810
|
}
|
|
246825
246811
|
return result.data;
|
|
246826
246812
|
}
|
|
246813
|
+
// src/core/utils/app-info.ts
|
|
246814
|
+
async function getAppUserToken() {
|
|
246815
|
+
try {
|
|
246816
|
+
const response = await getAppClient().get("auth/token").json();
|
|
246817
|
+
return response.token;
|
|
246818
|
+
} catch (error48) {
|
|
246819
|
+
throw await ApiError.fromHttpError(error48, "exchanging platform token for app user token");
|
|
246820
|
+
}
|
|
246821
|
+
}
|
|
246822
|
+
async function getSiteUrl(projectId) {
|
|
246823
|
+
const id = projectId ?? getAppConfig().id;
|
|
246824
|
+
let response;
|
|
246825
|
+
try {
|
|
246826
|
+
response = await base44Client.get(`api/apps/platform/${id}/published-url`);
|
|
246827
|
+
} catch (error48) {
|
|
246828
|
+
throw await ApiError.fromHttpError(error48, "fetching site URL");
|
|
246829
|
+
}
|
|
246830
|
+
const result = PublishedUrlResponseSchema.safeParse(await response.json());
|
|
246831
|
+
if (!result.success) {
|
|
246832
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
246833
|
+
}
|
|
246834
|
+
return result.data.url;
|
|
246835
|
+
}
|
|
246827
246836
|
// src/core/utils/dependencies.ts
|
|
246828
246837
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
246829
246838
|
function verifyDenoInstalled(context) {
|
|
@@ -251693,47 +251702,25 @@ function getDevCommand() {
|
|
|
251693
251702
|
// src/core/exec/run-script.ts
|
|
251694
251703
|
import { spawn as spawn3 } from "node:child_process";
|
|
251695
251704
|
import { copyFileSync, writeFileSync as writeFileSync2 } from "node:fs";
|
|
251696
|
-
import { resolve as resolve8 } from "node:path";
|
|
251697
|
-
async function getUserAppToken() {
|
|
251698
|
-
try {
|
|
251699
|
-
const response = await getAppClient().get("auth/token").json();
|
|
251700
|
-
return response.token;
|
|
251701
|
-
} catch (error48) {
|
|
251702
|
-
throw await ApiError.fromHttpError(error48, "exchanging platform token for app user token");
|
|
251703
|
-
}
|
|
251704
|
-
}
|
|
251705
251705
|
async function runScript(options8) {
|
|
251706
|
-
const {
|
|
251706
|
+
const { code: code2 } = options8;
|
|
251707
251707
|
verifyDenoInstalled("to run scripts with exec");
|
|
251708
251708
|
const cleanupFns = [];
|
|
251709
|
-
|
|
251710
|
-
|
|
251711
|
-
|
|
251712
|
-
|
|
251713
|
-
const tempScript = await $file({ postfix: ".ts" });
|
|
251714
|
-
cleanupFns.push(tempScript.cleanup);
|
|
251715
|
-
writeFileSync2(tempScript.path, code2, "utf-8");
|
|
251716
|
-
scriptPath = `file://${tempScript.path}`;
|
|
251717
|
-
} else {
|
|
251718
|
-
throw new Error("Either filePath or code must be provided");
|
|
251719
|
-
}
|
|
251709
|
+
const tempScript = await $file({ postfix: ".ts" });
|
|
251710
|
+
cleanupFns.push(tempScript.cleanup);
|
|
251711
|
+
writeFileSync2(tempScript.path, code2, "utf-8");
|
|
251712
|
+
const scriptPath = `file://${tempScript.path}`;
|
|
251720
251713
|
const appConfig = getAppConfig();
|
|
251721
251714
|
const [appUserToken, appBaseUrl] = await Promise.all([
|
|
251722
|
-
|
|
251715
|
+
getAppUserToken(),
|
|
251723
251716
|
getSiteUrl()
|
|
251724
251717
|
]);
|
|
251725
251718
|
const tempWrapper = await $file({ postfix: ".ts" });
|
|
251726
251719
|
cleanupFns.push(tempWrapper.cleanup);
|
|
251727
|
-
copyFileSync(
|
|
251720
|
+
copyFileSync(getExecWrapperPath(), tempWrapper.path);
|
|
251728
251721
|
try {
|
|
251729
251722
|
const exitCode = await new Promise((resolvePromise) => {
|
|
251730
|
-
const child = spawn3("deno", [
|
|
251731
|
-
"run",
|
|
251732
|
-
"--allow-all",
|
|
251733
|
-
"--node-modules-dir=auto",
|
|
251734
|
-
tempWrapper.path,
|
|
251735
|
-
...extraArgs
|
|
251736
|
-
], {
|
|
251723
|
+
const child = spawn3("deno", ["run", "--allow-all", "--node-modules-dir=auto", tempWrapper.path], {
|
|
251737
251724
|
env: {
|
|
251738
251725
|
...process.env,
|
|
251739
251726
|
SCRIPT_PATH: scriptPath,
|
|
@@ -251756,13 +251743,13 @@ async function runScript(options8) {
|
|
|
251756
251743
|
}
|
|
251757
251744
|
// src/cli/commands/exec.ts
|
|
251758
251745
|
function readStdin() {
|
|
251759
|
-
return new Promise((
|
|
251746
|
+
return new Promise((resolve8, reject) => {
|
|
251760
251747
|
let data = "";
|
|
251761
251748
|
process.stdin.setEncoding("utf-8");
|
|
251762
251749
|
process.stdin.on("data", (chunk) => {
|
|
251763
251750
|
data += chunk;
|
|
251764
251751
|
});
|
|
251765
|
-
process.stdin.on("end", () =>
|
|
251752
|
+
process.stdin.on("end", () => resolve8(data));
|
|
251766
251753
|
process.stdin.on("error", reject);
|
|
251767
251754
|
});
|
|
251768
251755
|
}
|
|
@@ -251780,13 +251767,7 @@ async function execAction() {
|
|
|
251780
251767
|
if (!code2.trim()) {
|
|
251781
251768
|
throw noInputError;
|
|
251782
251769
|
}
|
|
251783
|
-
const
|
|
251784
|
-
const extraArgs = dashIndex !== -1 ? process.argv.slice(dashIndex + 1) : [];
|
|
251785
|
-
const { exitCode } = await runScript({
|
|
251786
|
-
code: code2,
|
|
251787
|
-
extraArgs,
|
|
251788
|
-
execWrapperPath: getExecWrapperPath()
|
|
251789
|
-
});
|
|
251770
|
+
const { exitCode } = await runScript({ code: code2 });
|
|
251790
251771
|
if (exitCode !== 0) {
|
|
251791
251772
|
process.exitCode = exitCode;
|
|
251792
251773
|
}
|
|
@@ -251797,7 +251778,7 @@ function getExecCommand() {
|
|
|
251797
251778
|
}
|
|
251798
251779
|
|
|
251799
251780
|
// src/cli/commands/project/eject.ts
|
|
251800
|
-
import { resolve as
|
|
251781
|
+
import { resolve as resolve8 } from "node:path";
|
|
251801
251782
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
251802
251783
|
async function eject(options8) {
|
|
251803
251784
|
const projects = await listProjects();
|
|
@@ -251846,7 +251827,7 @@ async function eject(options8) {
|
|
|
251846
251827
|
Ne("Operation cancelled.");
|
|
251847
251828
|
throw new CLIExitError(0);
|
|
251848
251829
|
}
|
|
251849
|
-
const resolvedPath =
|
|
251830
|
+
const resolvedPath = resolve8(selectedPath);
|
|
251850
251831
|
await runTask("Downloading your project's code...", async (updateMessage) => {
|
|
251851
251832
|
await createProjectFilesForExistingProject({
|
|
251852
251833
|
projectId,
|
|
@@ -254224,14 +254205,14 @@ async function addSourceContext(frames) {
|
|
|
254224
254205
|
return frames;
|
|
254225
254206
|
}
|
|
254226
254207
|
function getContextLinesFromFile(path19, ranges, output) {
|
|
254227
|
-
return new Promise((
|
|
254208
|
+
return new Promise((resolve9) => {
|
|
254228
254209
|
const stream = createReadStream2(path19);
|
|
254229
254210
|
const lineReaded = createInterface2({
|
|
254230
254211
|
input: stream
|
|
254231
254212
|
});
|
|
254232
254213
|
function destroyStreamAndResolve() {
|
|
254233
254214
|
stream.destroy();
|
|
254234
|
-
|
|
254215
|
+
resolve9();
|
|
254235
254216
|
}
|
|
254236
254217
|
let lineNumber = 0;
|
|
254237
254218
|
let currentRangeIndex = 0;
|
|
@@ -255343,15 +255324,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
255343
255324
|
return true;
|
|
255344
255325
|
if (this.featureFlagsPoller === undefined)
|
|
255345
255326
|
return false;
|
|
255346
|
-
return new Promise((
|
|
255327
|
+
return new Promise((resolve9) => {
|
|
255347
255328
|
const timeout3 = setTimeout(() => {
|
|
255348
255329
|
cleanup();
|
|
255349
|
-
|
|
255330
|
+
resolve9(false);
|
|
255350
255331
|
}, timeoutMs);
|
|
255351
255332
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
|
|
255352
255333
|
clearTimeout(timeout3);
|
|
255353
255334
|
cleanup();
|
|
255354
|
-
|
|
255335
|
+
resolve9(count2 > 0);
|
|
255355
255336
|
});
|
|
255356
255337
|
});
|
|
255357
255338
|
}
|
|
@@ -256170,4 +256151,4 @@ export {
|
|
|
256170
256151
|
CLIExitError
|
|
256171
256152
|
};
|
|
256172
256153
|
|
|
256173
|
-
//# debugId=
|
|
256154
|
+
//# debugId=F3C4DA6F1465E60364756E2164756E21
|