@base44-preview/cli 0.1.16-pr.635.2ec10a1 → 0.1.16-pr.635.901076f

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
@@ -230706,7 +230706,7 @@ var TemplatesConfigSchema = object({
230706
230706
  });
230707
230707
  var SiteConfigSchema = object({
230708
230708
  buildCommand: string2().optional().default("npm run build"),
230709
- serveCommand: string2().optional().default("npm run dev"),
230709
+ serveCommand: string2().optional(),
230710
230710
  outputDirectory: string2().optional().default("./dist"),
230711
230711
  installCommand: string2().optional().default("npm install"),
230712
230712
  devHostFlag: string2().optional().default("--host")
@@ -246681,6 +246681,7 @@ async function gitHead(projectRoot) {
246681
246681
  }
246682
246682
  }
246683
246683
  // src/core/site/serve-command.ts
246684
+ var DEFAULT_SERVE_COMMAND = "npm run dev";
246684
246685
  var NPM_RUN_COMMAND = /^npm(\s+--prefix\s+\S+)?\s+run\s+\S+$/;
246685
246686
  function withServeAddress(serveCommand, { host, port, hostFlag }) {
246686
246687
  const args = [
@@ -249597,7 +249598,7 @@ async function buildAction(ctx) {
249597
249598
  };
249598
249599
  }
249599
249600
  function getBuildCommand() {
249600
- return new Base44Command("build").description("Build the site with the Base44 app id injected").action(buildAction);
249601
+ return new Base44Command("build", { requireAuth: false }).description("Build the site with the Base44 app id injected").action(buildAction);
249601
249602
  }
249602
249603
 
249603
249604
  // src/cli/commands/project/create.ts
@@ -251255,7 +251256,7 @@ function createServeCommandRunner({
251255
251256
  cwd: projectRoot,
251256
251257
  env: {
251257
251258
  VITE_BASE44_APP_ID: appId,
251258
- VITE_BASE44_APP_BASE_URL: appBaseUrl
251259
+ ...appBaseUrl ? { VITE_BASE44_APP_BASE_URL: appBaseUrl } : {}
251259
251260
  },
251260
251261
  logger: createDevLogger("frontend", theme.colors.base44Orange)
251261
251262
  });
@@ -251284,13 +251285,14 @@ async function siteDevAction(ctx, options) {
251284
251285
  if (!site) {
251285
251286
  throw new InvalidInputError(`This project has no 'site' block in base44/config.jsonc, so there is no frontend to serve. Add one; inside it serveCommand defaults to "npm run dev".`);
251286
251287
  }
251287
- const command = withServeAddress(site.serveCommand, {
251288
+ const serveCommand = site.serveCommand ?? DEFAULT_SERVE_COMMAND;
251289
+ const command = withServeAddress(serveCommand, {
251288
251290
  host: options.host,
251289
251291
  port,
251290
251292
  hostFlag: site.devHostFlag
251291
251293
  });
251292
- if ((options.host || port !== undefined) && !forwardsServeAddress(site.serveCommand)) {
251293
- log.warn(`serveCommand '${site.serveCommand}' is not an 'npm run' invocation, so --host/--port were not passed to it. Put the address in serveCommand itself.`);
251294
+ if ((options.host || port !== undefined) && !forwardsServeAddress(serveCommand)) {
251295
+ log.warn(`serveCommand '${serveCommand}' is not an 'npm run' invocation, so --host/--port were not passed to it. Put the address in serveCommand itself.`);
251294
251296
  }
251295
251297
  const runner = createServeCommandRunner({
251296
251298
  serveCommand: command,
@@ -251302,11 +251304,11 @@ async function siteDevAction(ctx, options) {
251302
251304
  runner.onExit((code) => process.exit(code ?? 1));
251303
251305
  runner.start();
251304
251306
  return {
251305
- outroMessage: `Frontend dev server running '${command}' against ${theme.styles.bold(options.backendUrl)}`
251307
+ outroMessage: options.backendUrl ? `Frontend dev server running '${command}' against ${theme.styles.bold(options.backendUrl)}` : `Frontend dev server running '${command}'`
251306
251308
  };
251307
251309
  }
251308
251310
  function getSiteDevCommand() {
251309
- return new Base44Command("dev", { requireAuth: false }).description("Run the site's dev server against a given backend (no local backend)").requiredOption("--backend-url <url>", "Backend the frontend should call, injected as VITE_BASE44_APP_BASE_URL").option("--host <address>", "Address to bind, e.g. 0.0.0.0").option("--port <number>", "Port to bind").action(siteDevAction);
251311
+ 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, e.g. 0.0.0.0").option("--port <number>", "Port to bind").action(siteDevAction);
251310
251312
  }
251311
251313
 
251312
251314
  // src/cli/commands/site/open.ts
@@ -255650,7 +255652,7 @@ function startServeCommand(runner, backend) {
255650
255652
  async function remoteDevAction(app) {
255651
255653
  const site = await resolveConfiguredSite(app);
255652
255654
  if (!site) {
255653
- throw new ConfigInvalidError(`base44 dev --remote serves the frontend against the production backend, but this project has no 'site' block in base44/config.jsonc. Add one; inside it serveCommand defaults to "npm run dev".`);
255655
+ throw new ConfigInvalidError("base44 dev --remote serves the frontend against the production backend, but this project has no site.serveCommand in base44/config.jsonc.");
255654
255656
  }
255655
255657
  const appBaseUrl = await getSiteUrl();
255656
255658
  const runner = createServeCommandRunner({
@@ -260019,4 +260021,4 @@ export {
260019
260021
  runCLI
260020
260022
  };
260021
260023
 
260022
- //# debugId=26F032DEEC9B5A8664756E2164756E21
260024
+ //# debugId=1B4036764E7405DA64756E2164756E21