@base44-preview/cli 0.1.17-pr.635.d9ecd72 → 0.1.17-pr.635.fd9bbfb
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 +10 -26
- package/dist/cli/index.js.map +5 -5
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -230722,7 +230722,9 @@ var SiteConfigSchema = object({
|
|
|
230722
230722
|
serveCommand: string2().optional(),
|
|
230723
230723
|
outputDirectory: string2().optional(),
|
|
230724
230724
|
installCommand: string2().default("npm install"),
|
|
230725
|
-
devHostFlag: string2().default("--host")
|
|
230725
|
+
devHostFlag: string2().default("--host"),
|
|
230726
|
+
devHost: string2().default("0.0.0.0"),
|
|
230727
|
+
devPort: number2().int().min(1).max(65535).default(5173)
|
|
230726
230728
|
});
|
|
230727
230729
|
var PluginMetadataSchema = object({
|
|
230728
230730
|
namespace: string2().min(1, "Plugin namespace cannot be empty").regex(/^[a-zA-Z0-9_-]+$/, "Plugin namespace can only contain letters, numbers, underscores, and dashes")
|
|
@@ -246726,13 +246728,7 @@ function runnerFor(serveCommand) {
|
|
|
246726
246728
|
}
|
|
246727
246729
|
function withServeAddress(serveCommand, { host, port, hostFlag }) {
|
|
246728
246730
|
const command = serveCommand.trim();
|
|
246729
|
-
const args = [
|
|
246730
|
-
...host ? [hostFlag, host] : [],
|
|
246731
|
-
...port === undefined ? [] : ["--port", String(port)]
|
|
246732
|
-
];
|
|
246733
|
-
if (args.length === 0) {
|
|
246734
|
-
return { command, droppedAddress: false };
|
|
246735
|
-
}
|
|
246731
|
+
const args = [hostFlag, host, "--port", String(port)];
|
|
246736
246732
|
const runner = runnerFor(command);
|
|
246737
246733
|
if (!runner) {
|
|
246738
246734
|
return { command, droppedAddress: true };
|
|
@@ -251317,18 +251313,6 @@ function stopRunnerOnProcessSignals(runner) {
|
|
|
251317
251313
|
}
|
|
251318
251314
|
|
|
251319
251315
|
// src/cli/commands/site/dev.ts
|
|
251320
|
-
var DEFAULT_DEV_HOST = "0.0.0.0";
|
|
251321
|
-
var DEFAULT_DEV_PORT = 5173;
|
|
251322
|
-
function parsePort(value) {
|
|
251323
|
-
if (!/^\d+$/.test(value)) {
|
|
251324
|
-
throw new InvalidArgumentError2("must be a whole number");
|
|
251325
|
-
}
|
|
251326
|
-
const port = Number(value);
|
|
251327
|
-
if (port < 1 || port > 65535) {
|
|
251328
|
-
throw new InvalidArgumentError2("must be between 1 and 65535");
|
|
251329
|
-
}
|
|
251330
|
-
return port;
|
|
251331
|
-
}
|
|
251332
251316
|
async function siteDevAction(ctx, options) {
|
|
251333
251317
|
const { app } = ctx;
|
|
251334
251318
|
if (!app?.projectRoot) {
|
|
@@ -251341,8 +251325,8 @@ async function siteDevAction(ctx, options) {
|
|
|
251341
251325
|
}
|
|
251342
251326
|
const serveCommand = site.serveCommand ?? DEFAULT_SERVE_COMMAND;
|
|
251343
251327
|
const { command, droppedAddress } = withServeAddress(serveCommand, {
|
|
251344
|
-
host:
|
|
251345
|
-
port:
|
|
251328
|
+
host: site.devHost,
|
|
251329
|
+
port: site.devPort,
|
|
251346
251330
|
hostFlag: site.devHostFlag
|
|
251347
251331
|
});
|
|
251348
251332
|
if (droppedAddress) {
|
|
@@ -251362,7 +251346,7 @@ async function siteDevAction(ctx, options) {
|
|
|
251362
251346
|
};
|
|
251363
251347
|
}
|
|
251364
251348
|
function getSiteDevCommand() {
|
|
251365
|
-
return new Base44Command("dev", { requireAuth: false }).description("Run the site's dev server against a given backend (no local backend)").option("--backend-url <url>", "Backend the frontend should call, injected as VITE_BASE44_APP_BASE_URL. Omit for a frontend that reaches its backend same-origin.").
|
|
251349
|
+
return new Base44Command("dev", { requireAuth: false }).description("Run the site's dev server against a given backend (no local backend)").option("--backend-url <url>", "Backend the frontend should call, injected as VITE_BASE44_APP_BASE_URL. Omit for a frontend that reaches its backend same-origin.").action(siteDevAction);
|
|
251366
251350
|
}
|
|
251367
251351
|
|
|
251368
251352
|
// src/cli/commands/site/open.ts
|
|
@@ -255808,7 +255792,7 @@ function readStdin2() {
|
|
|
255808
255792
|
process.stdin.on("error", reject);
|
|
255809
255793
|
});
|
|
255810
255794
|
}
|
|
255811
|
-
function
|
|
255795
|
+
function parsePort(value) {
|
|
255812
255796
|
const port = Number(value);
|
|
255813
255797
|
if (!Number.isInteger(port) || port <= 0 || port > 65535) {
|
|
255814
255798
|
throw new InvalidInputError(`Invalid --port value: "${value}".`, {
|
|
@@ -255845,7 +255829,7 @@ async function execAction({ app, isNonInteractive }, options) {
|
|
|
255845
255829
|
if (!code.trim()) {
|
|
255846
255830
|
throw noInputError;
|
|
255847
255831
|
}
|
|
255848
|
-
const local = options.local ? await resolveLocalTarget(options.port !== undefined ?
|
|
255832
|
+
const local = options.local ? await resolveLocalTarget(options.port !== undefined ? parsePort(options.port) : DEFAULT_DEV_SERVER_PORT) : undefined;
|
|
255849
255833
|
const { exitCode } = await runScript({
|
|
255850
255834
|
appId: app.id,
|
|
255851
255835
|
code,
|
|
@@ -260080,4 +260064,4 @@ export {
|
|
|
260080
260064
|
runCLI
|
|
260081
260065
|
};
|
|
260082
260066
|
|
|
260083
|
-
//# debugId=
|
|
260067
|
+
//# debugId=8C0EDF181791840B64756E2164756E21
|