@base44-preview/cli 0.1.17-pr.635.7aa76fd → 0.1.17-pr.635.d9ecd72

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 CHANGED
@@ -230722,9 +230722,7 @@ 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"),
230726
- devHost: string2().default("0.0.0.0"),
230727
- devPort: number2().int().min(1).max(65535).default(5173)
230725
+ devHostFlag: string2().default("--host")
230728
230726
  });
230729
230727
  var PluginMetadataSchema = object({
230730
230728
  namespace: string2().min(1, "Plugin namespace cannot be empty").regex(/^[a-zA-Z0-9_-]+$/, "Plugin namespace can only contain letters, numbers, underscores, and dashes")
@@ -246728,7 +246726,13 @@ function runnerFor(serveCommand) {
246728
246726
  }
246729
246727
  function withServeAddress(serveCommand, { host, port, hostFlag }) {
246730
246728
  const command = serveCommand.trim();
246731
- const args = [hostFlag, host, "--port", String(port)];
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
+ }
246732
246736
  const runner = runnerFor(command);
246733
246737
  if (!runner) {
246734
246738
  return { command, droppedAddress: true };
@@ -251313,6 +251317,18 @@ function stopRunnerOnProcessSignals(runner) {
251313
251317
  }
251314
251318
 
251315
251319
  // 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
+ }
251316
251332
  async function siteDevAction(ctx, options) {
251317
251333
  const { app } = ctx;
251318
251334
  if (!app?.projectRoot) {
@@ -251325,8 +251341,8 @@ async function siteDevAction(ctx, options) {
251325
251341
  }
251326
251342
  const serveCommand = site.serveCommand ?? DEFAULT_SERVE_COMMAND;
251327
251343
  const { command, droppedAddress } = withServeAddress(serveCommand, {
251328
- host: site.devHost,
251329
- port: site.devPort,
251344
+ host: options.host ?? DEFAULT_DEV_HOST,
251345
+ port: options.port ?? DEFAULT_DEV_PORT,
251330
251346
  hostFlag: site.devHostFlag
251331
251347
  });
251332
251348
  if (droppedAddress) {
@@ -251346,7 +251362,7 @@ async function siteDevAction(ctx, options) {
251346
251362
  };
251347
251363
  }
251348
251364
  function getSiteDevCommand() {
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);
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.").option("--host <address>", "Address to bind (default: 0.0.0.0)").option("--port <number>", "Port to bind (default: 5173)", parsePort).action(siteDevAction);
251350
251366
  }
251351
251367
 
251352
251368
  // src/cli/commands/site/open.ts
@@ -255792,7 +255808,7 @@ function readStdin2() {
255792
255808
  process.stdin.on("error", reject);
255793
255809
  });
255794
255810
  }
255795
- function parsePort(value) {
255811
+ function parsePort2(value) {
255796
255812
  const port = Number(value);
255797
255813
  if (!Number.isInteger(port) || port <= 0 || port > 65535) {
255798
255814
  throw new InvalidInputError(`Invalid --port value: "${value}".`, {
@@ -255829,7 +255845,7 @@ async function execAction({ app, isNonInteractive }, options) {
255829
255845
  if (!code.trim()) {
255830
255846
  throw noInputError;
255831
255847
  }
255832
- const local = options.local ? await resolveLocalTarget(options.port !== undefined ? parsePort(options.port) : DEFAULT_DEV_SERVER_PORT) : undefined;
255848
+ const local = options.local ? await resolveLocalTarget(options.port !== undefined ? parsePort2(options.port) : DEFAULT_DEV_SERVER_PORT) : undefined;
255833
255849
  const { exitCode } = await runScript({
255834
255850
  appId: app.id,
255835
255851
  code,
@@ -260064,4 +260080,4 @@ export {
260064
260080
  runCLI
260065
260081
  };
260066
260082
 
260067
- //# debugId=8C0EDF181791840B64756E2164756E21
260083
+ //# debugId=E4900ACB9D3C9A4264756E2164756E21