@base44-preview/cli 0.1.17-pr.635.e302685 → 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 -29
- package/dist/cli/index.js.map +5 -5
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -230722,9 +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().
|
|
230726
|
-
devHost: string2().
|
|
230727
|
-
devPort: number2().int().min(1).max(65535).
|
|
230725
|
+
devHostFlag: string2().default("--host"),
|
|
230726
|
+
devHost: string2().default("0.0.0.0"),
|
|
230727
|
+
devPort: number2().int().min(1).max(65535).default(5173)
|
|
230728
230728
|
});
|
|
230729
230729
|
var PluginMetadataSchema = object({
|
|
230730
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")
|
|
@@ -246711,9 +246711,6 @@ async function gitHead(projectRoot) {
|
|
|
246711
246711
|
}
|
|
246712
246712
|
// src/core/site/serve-command.ts
|
|
246713
246713
|
var DEFAULT_SERVE_COMMAND = "npm run dev";
|
|
246714
|
-
var DEFAULT_HOST_FLAG = "--host";
|
|
246715
|
-
var DEFAULT_DEV_HOST = "0.0.0.0";
|
|
246716
|
-
var DEFAULT_DEV_PORT = 5173;
|
|
246717
246714
|
var SCRIPT = "[A-Za-z0-9:_.-]+";
|
|
246718
246715
|
var PREFIX2 = "[A-Za-z0-9._/-]+";
|
|
246719
246716
|
var SCRIPT_RUNNERS = [
|
|
@@ -246731,13 +246728,7 @@ function runnerFor(serveCommand) {
|
|
|
246731
246728
|
}
|
|
246732
246729
|
function withServeAddress(serveCommand, { host, port, hostFlag }) {
|
|
246733
246730
|
const command = serveCommand.trim();
|
|
246734
|
-
const args = [
|
|
246735
|
-
...host ? [hostFlag ?? DEFAULT_HOST_FLAG, host] : [],
|
|
246736
|
-
...port === undefined ? [] : ["--port", String(port)]
|
|
246737
|
-
];
|
|
246738
|
-
if (args.length === 0) {
|
|
246739
|
-
return { command, droppedAddress: false };
|
|
246740
|
-
}
|
|
246731
|
+
const args = [hostFlag, host, "--port", String(port)];
|
|
246741
246732
|
const runner = runnerFor(command);
|
|
246742
246733
|
if (!runner) {
|
|
246743
246734
|
return { command, droppedAddress: true };
|
|
@@ -251322,16 +251313,6 @@ function stopRunnerOnProcessSignals(runner) {
|
|
|
251322
251313
|
}
|
|
251323
251314
|
|
|
251324
251315
|
// src/cli/commands/site/dev.ts
|
|
251325
|
-
function parsePort(value) {
|
|
251326
|
-
if (!/^\d+$/.test(value)) {
|
|
251327
|
-
throw new InvalidArgumentError2("must be a whole number");
|
|
251328
|
-
}
|
|
251329
|
-
const port = Number(value);
|
|
251330
|
-
if (port < 1 || port > 65535) {
|
|
251331
|
-
throw new InvalidArgumentError2("must be between 1 and 65535");
|
|
251332
|
-
}
|
|
251333
|
-
return port;
|
|
251334
|
-
}
|
|
251335
251316
|
async function siteDevAction(ctx, options) {
|
|
251336
251317
|
const { app } = ctx;
|
|
251337
251318
|
if (!app?.projectRoot) {
|
|
@@ -251344,8 +251325,8 @@ async function siteDevAction(ctx, options) {
|
|
|
251344
251325
|
}
|
|
251345
251326
|
const serveCommand = site.serveCommand ?? DEFAULT_SERVE_COMMAND;
|
|
251346
251327
|
const { command, droppedAddress } = withServeAddress(serveCommand, {
|
|
251347
|
-
host:
|
|
251348
|
-
port:
|
|
251328
|
+
host: site.devHost,
|
|
251329
|
+
port: site.devPort,
|
|
251349
251330
|
hostFlag: site.devHostFlag
|
|
251350
251331
|
});
|
|
251351
251332
|
if (droppedAddress) {
|
|
@@ -251365,7 +251346,7 @@ async function siteDevAction(ctx, options) {
|
|
|
251365
251346
|
};
|
|
251366
251347
|
}
|
|
251367
251348
|
function getSiteDevCommand() {
|
|
251368
|
-
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);
|
|
251369
251350
|
}
|
|
251370
251351
|
|
|
251371
251352
|
// src/cli/commands/site/open.ts
|
|
@@ -255811,7 +255792,7 @@ function readStdin2() {
|
|
|
255811
255792
|
process.stdin.on("error", reject);
|
|
255812
255793
|
});
|
|
255813
255794
|
}
|
|
255814
|
-
function
|
|
255795
|
+
function parsePort(value) {
|
|
255815
255796
|
const port = Number(value);
|
|
255816
255797
|
if (!Number.isInteger(port) || port <= 0 || port > 65535) {
|
|
255817
255798
|
throw new InvalidInputError(`Invalid --port value: "${value}".`, {
|
|
@@ -255848,7 +255829,7 @@ async function execAction({ app, isNonInteractive }, options) {
|
|
|
255848
255829
|
if (!code.trim()) {
|
|
255849
255830
|
throw noInputError;
|
|
255850
255831
|
}
|
|
255851
|
-
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;
|
|
255852
255833
|
const { exitCode } = await runScript({
|
|
255853
255834
|
appId: app.id,
|
|
255854
255835
|
code,
|
|
@@ -260083,4 +260064,4 @@ export {
|
|
|
260083
260064
|
runCLI
|
|
260084
260065
|
};
|
|
260085
260066
|
|
|
260086
|
-
//# debugId=
|
|
260067
|
+
//# debugId=8C0EDF181791840B64756E2164756E21
|