@base44-preview/cli 0.1.6-pr.580.20770cc → 0.1.6-pr.580.6f69633
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
|
@@ -247293,7 +247293,9 @@ async function deploySite(siteOutputDir) {
|
|
|
247293
247293
|
if (!await pathExists(siteOutputDir)) {
|
|
247294
247294
|
throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
|
|
247295
247295
|
hints: [
|
|
247296
|
-
{
|
|
247296
|
+
{
|
|
247297
|
+
message: "Run 'base44 build' first (it injects your app id; a bare 'npm run build' does not)"
|
|
247298
|
+
}
|
|
247297
247299
|
]
|
|
247298
247300
|
});
|
|
247299
247301
|
}
|
|
@@ -247301,7 +247303,9 @@ async function deploySite(siteOutputDir) {
|
|
|
247301
247303
|
if (filePaths.length === 0) {
|
|
247302
247304
|
throw new ConfigInvalidError(`No files found in output directory: ${siteOutputDir}. Make sure to build your project first.`, siteOutputDir, {
|
|
247303
247305
|
hints: [
|
|
247304
|
-
{
|
|
247306
|
+
{
|
|
247307
|
+
message: "Run 'base44 build' first (it injects your app id; a bare 'npm run build' does not)"
|
|
247308
|
+
}
|
|
247305
247309
|
]
|
|
247306
247310
|
});
|
|
247307
247311
|
}
|
|
@@ -256422,6 +256426,68 @@ function getFunctionsCommand() {
|
|
|
256422
256426
|
return new Command("functions").description("Manage backend functions").addCommand(getDeployCommand()).addCommand(getDeleteCommand()).addCommand(getListCommand()).addCommand(getPullCommand());
|
|
256423
256427
|
}
|
|
256424
256428
|
|
|
256429
|
+
// src/cli/commands/project/site-build.ts
|
|
256430
|
+
async function runSiteBuild({ runTask: runTask2 }, { root, buildCommand, appId }) {
|
|
256431
|
+
if (!buildCommand) {
|
|
256432
|
+
throw new ConfigNotFoundError("No site build command found.", {
|
|
256433
|
+
hints: [
|
|
256434
|
+
{
|
|
256435
|
+
message: `Add 'site.buildCommand' to your config.jsonc (e.g., "site": { "buildCommand": "npm run build" })`
|
|
256436
|
+
}
|
|
256437
|
+
]
|
|
256438
|
+
});
|
|
256439
|
+
}
|
|
256440
|
+
await runTask2("Building site...", async () => {
|
|
256441
|
+
await execa({
|
|
256442
|
+
cwd: root,
|
|
256443
|
+
shell: true,
|
|
256444
|
+
env: { VITE_BASE44_APP_ID: appId }
|
|
256445
|
+
})`${buildCommand}`;
|
|
256446
|
+
}, {
|
|
256447
|
+
successMessage: "Site built successfully",
|
|
256448
|
+
errorMessage: "Build failed"
|
|
256449
|
+
});
|
|
256450
|
+
}
|
|
256451
|
+
async function shouldBuildBeforeDeploy({
|
|
256452
|
+
build,
|
|
256453
|
+
isNonInteractive,
|
|
256454
|
+
buildCommand
|
|
256455
|
+
}) {
|
|
256456
|
+
if (!buildCommand) {
|
|
256457
|
+
return false;
|
|
256458
|
+
}
|
|
256459
|
+
if (build !== undefined) {
|
|
256460
|
+
return build;
|
|
256461
|
+
}
|
|
256462
|
+
if (isNonInteractive) {
|
|
256463
|
+
return false;
|
|
256464
|
+
}
|
|
256465
|
+
const answer = await Re({
|
|
256466
|
+
message: `Build the site first? (runs '${buildCommand}' with your app id)`
|
|
256467
|
+
});
|
|
256468
|
+
return !Ct(answer) && answer;
|
|
256469
|
+
}
|
|
256470
|
+
|
|
256471
|
+
// src/cli/commands/project/build.ts
|
|
256472
|
+
async function buildAction(ctx) {
|
|
256473
|
+
const { app } = ctx;
|
|
256474
|
+
if (!app?.projectRoot) {
|
|
256475
|
+
throw new ConfigInvalidError("base44 build requires a linked local project. Run it from a project with base44/.app.jsonc.");
|
|
256476
|
+
}
|
|
256477
|
+
const { project: project2 } = await readProjectConfig(app.projectRoot);
|
|
256478
|
+
await runSiteBuild(ctx, {
|
|
256479
|
+
root: project2.root,
|
|
256480
|
+
buildCommand: project2.site?.buildCommand,
|
|
256481
|
+
appId: app.id
|
|
256482
|
+
});
|
|
256483
|
+
return {
|
|
256484
|
+
outroMessage: `Site built with app id ${theme.styles.bold(app.id)}`
|
|
256485
|
+
};
|
|
256486
|
+
}
|
|
256487
|
+
function getBuildCommand() {
|
|
256488
|
+
return new Base44Command("build").description("Build the site with the Base44 app id injected").action(buildAction);
|
|
256489
|
+
}
|
|
256490
|
+
|
|
256425
256491
|
// src/cli/commands/project/create.ts
|
|
256426
256492
|
import { basename as basename4, resolve as resolve8 } from "node:path";
|
|
256427
256493
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
@@ -256694,7 +256760,8 @@ Examples:
|
|
|
256694
256760
|
}
|
|
256695
256761
|
|
|
256696
256762
|
// src/cli/commands/project/deploy.ts
|
|
256697
|
-
async function deployAction(
|
|
256763
|
+
async function deployAction(ctx, options = {}) {
|
|
256764
|
+
const { isNonInteractive, log } = ctx;
|
|
256698
256765
|
if (isNonInteractive && !options.yes) {
|
|
256699
256766
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
256700
256767
|
}
|
|
@@ -256742,6 +256809,20 @@ ${summaryLines.join(`
|
|
|
256742
256809
|
${summaryLines.join(`
|
|
256743
256810
|
`)}`);
|
|
256744
256811
|
}
|
|
256812
|
+
if (project2.site?.outputDirectory && ctx.app) {
|
|
256813
|
+
const shouldBuild = await shouldBuildBeforeDeploy({
|
|
256814
|
+
build: options.build,
|
|
256815
|
+
isNonInteractive,
|
|
256816
|
+
buildCommand: project2.site.buildCommand
|
|
256817
|
+
});
|
|
256818
|
+
if (shouldBuild) {
|
|
256819
|
+
await runSiteBuild(ctx, {
|
|
256820
|
+
root: project2.root,
|
|
256821
|
+
buildCommand: project2.site.buildCommand,
|
|
256822
|
+
appId: ctx.app.id
|
|
256823
|
+
});
|
|
256824
|
+
}
|
|
256825
|
+
}
|
|
256745
256826
|
let functionCompleted = 0;
|
|
256746
256827
|
const functionTotal = functions.length;
|
|
256747
256828
|
const result = await deployAll(projectData, {
|
|
@@ -256770,7 +256851,7 @@ ${summaryLines.join(`
|
|
|
256770
256851
|
return { outroMessage: "App deployed successfully" };
|
|
256771
256852
|
}
|
|
256772
256853
|
function getDeployCommand2() {
|
|
256773
|
-
return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(deployAction);
|
|
256854
|
+
return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").option("--build", "Build the site before deploying (skips the prompt)").option("--no-build", "Deploy without building (skips the prompt)").action(deployAction);
|
|
256774
256855
|
}
|
|
256775
256856
|
async function handleOAuthConnectors(connectorResults, isNonInteractive, options, log) {
|
|
256776
256857
|
const needsOAuth = filterPendingOAuth(connectorResults);
|
|
@@ -257636,7 +257717,8 @@ function getSecretsCommand() {
|
|
|
257636
257717
|
|
|
257637
257718
|
// src/cli/commands/site/deploy.ts
|
|
257638
257719
|
import { resolve as resolve11 } from "node:path";
|
|
257639
|
-
async function deployAction2(
|
|
257720
|
+
async function deployAction2(ctx, options) {
|
|
257721
|
+
const { isNonInteractive, runTask: runTask2 } = ctx;
|
|
257640
257722
|
if (isNonInteractive && !options.yes) {
|
|
257641
257723
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
257642
257724
|
}
|
|
@@ -257659,6 +257741,18 @@ async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
|
257659
257741
|
return { outroMessage: "Deployment cancelled" };
|
|
257660
257742
|
}
|
|
257661
257743
|
}
|
|
257744
|
+
const shouldBuild = await shouldBuildBeforeDeploy({
|
|
257745
|
+
build: options.build,
|
|
257746
|
+
isNonInteractive,
|
|
257747
|
+
buildCommand: project2.site.buildCommand
|
|
257748
|
+
});
|
|
257749
|
+
if (shouldBuild && ctx.app) {
|
|
257750
|
+
await runSiteBuild(ctx, {
|
|
257751
|
+
root: project2.root,
|
|
257752
|
+
buildCommand: project2.site.buildCommand,
|
|
257753
|
+
appId: ctx.app.id
|
|
257754
|
+
});
|
|
257755
|
+
}
|
|
257662
257756
|
const result = await runTask2("Creating archive and deploying site...", async () => {
|
|
257663
257757
|
return await deploySite(outputDir);
|
|
257664
257758
|
}, {
|
|
@@ -257668,7 +257762,7 @@ async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
|
257668
257762
|
return { outroMessage: `Visit your site at: ${result.appUrl}` };
|
|
257669
257763
|
}
|
|
257670
257764
|
function getSiteDeployCommand() {
|
|
257671
|
-
return new Base44Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").action(deployAction2);
|
|
257765
|
+
return new Base44Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").option("--build", "Build the site before deploying (skips the prompt)").option("--no-build", "Deploy without building (skips the prompt)").action(deployAction2);
|
|
257672
257766
|
}
|
|
257673
257767
|
|
|
257674
257768
|
// src/cli/commands/site/open.ts
|
|
@@ -261892,6 +261986,7 @@ function startRemoteServe(options8) {
|
|
|
261892
261986
|
}
|
|
261893
261987
|
function createRemoteServeRunner({
|
|
261894
261988
|
appId,
|
|
261989
|
+
appBaseUrl,
|
|
261895
261990
|
serveCommand,
|
|
261896
261991
|
projectRoot
|
|
261897
261992
|
}) {
|
|
@@ -261903,7 +261998,7 @@ function createRemoteServeRunner({
|
|
|
261903
261998
|
cwd: projectRoot,
|
|
261904
261999
|
env: {
|
|
261905
262000
|
VITE_BASE44_APP_ID: appId,
|
|
261906
|
-
VITE_BASE44_APP_BASE_URL:
|
|
262001
|
+
VITE_BASE44_APP_BASE_URL: appBaseUrl
|
|
261907
262002
|
},
|
|
261908
262003
|
logger: createDevLogger("frontend", theme.colors.base44Orange)
|
|
261909
262004
|
});
|
|
@@ -261928,15 +262023,18 @@ function validateDevOptions(command2) {
|
|
|
261928
262023
|
command2.error("--port applies to the local backend, which --remote does not start.");
|
|
261929
262024
|
}
|
|
261930
262025
|
}
|
|
262026
|
+
var remoteBackendUrl = () => getSiteUrl().catch(() => BASE44_APP_URL);
|
|
261931
262027
|
async function remoteDevAction(app) {
|
|
261932
262028
|
const { project: project2 } = await readProjectConfig(app.projectRoot);
|
|
262029
|
+
const appBaseUrl = await remoteBackendUrl();
|
|
261933
262030
|
startRemoteServe({
|
|
261934
262031
|
appId: app.id,
|
|
262032
|
+
appBaseUrl,
|
|
261935
262033
|
serveCommand: project2.site?.serveCommand,
|
|
261936
262034
|
projectRoot: project2.root
|
|
261937
262035
|
});
|
|
261938
262036
|
return {
|
|
261939
|
-
outroMessage: `Frontend dev server targets ${theme.styles.bold(
|
|
262037
|
+
outroMessage: `Frontend dev server targets ${theme.styles.bold(appBaseUrl)} — every write hits your live app`
|
|
261940
262038
|
};
|
|
261941
262039
|
}
|
|
261942
262040
|
async function devAction(ctx, options8) {
|
|
@@ -262186,7 +262284,11 @@ async function eject(ctx, options8, command2) {
|
|
|
262186
262284
|
successMessage: theme.colors.base44Orange("Project built successfully"),
|
|
262187
262285
|
errorMessage: "Failed to build project"
|
|
262188
262286
|
});
|
|
262189
|
-
await deployAction(ctx, {
|
|
262287
|
+
await deployAction(ctx, {
|
|
262288
|
+
yes: true,
|
|
262289
|
+
build: false,
|
|
262290
|
+
projectRoot: resolvedPath
|
|
262291
|
+
});
|
|
262190
262292
|
}
|
|
262191
262293
|
}
|
|
262192
262294
|
return { outroMessage: "Your new project is set and ready to use" };
|
|
@@ -262215,6 +262317,7 @@ function createProgram(context) {
|
|
|
262215
262317
|
program2.addCommand(getCreateCommand());
|
|
262216
262318
|
program2.addCommand(getScaffoldCommand());
|
|
262217
262319
|
program2.addCommand(getDashboardCommand());
|
|
262320
|
+
program2.addCommand(getBuildCommand());
|
|
262218
262321
|
program2.addCommand(getDeployCommand2());
|
|
262219
262322
|
program2.addCommand(getVisibilityCommand());
|
|
262220
262323
|
program2.addCommand(getLinkCommand());
|
|
@@ -266479,4 +266582,4 @@ export {
|
|
|
266479
266582
|
CLIExitError
|
|
266480
266583
|
};
|
|
266481
266584
|
|
|
266482
|
-
//# debugId=
|
|
266585
|
+
//# debugId=04793601E8E5DA5764756E2164756E21
|