@base44-preview/cli 0.0.15-pr.87.be3c643 → 0.0.15-pr.87.e3632a6
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 +50 -15
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -38095,7 +38095,7 @@ async function getTemplateById(templateId) {
|
|
|
38095
38095
|
}
|
|
38096
38096
|
return template;
|
|
38097
38097
|
}
|
|
38098
|
-
function validateNonInteractiveFlags$
|
|
38098
|
+
function validateNonInteractiveFlags$2(command) {
|
|
38099
38099
|
const { name: name$1, path: path$16, json } = command.optsWithGlobals();
|
|
38100
38100
|
const providedCount = [name$1, path$16].filter(Boolean).length;
|
|
38101
38101
|
if (json && providedCount < 2) command.error("JSON mode requires all flags: --name, --path");
|
|
@@ -38222,9 +38222,10 @@ async function executeCreate({ template, name: rawName, description, projectPath
|
|
|
38222
38222
|
finalAppUrl = appUrl;
|
|
38223
38223
|
}
|
|
38224
38224
|
}
|
|
38225
|
+
const dashboardUrl = getDashboardUrl(projectId);
|
|
38225
38226
|
if (!isJsonMode()) {
|
|
38226
38227
|
M.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name$1)}`);
|
|
38227
|
-
M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(
|
|
38228
|
+
M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(dashboardUrl)}`);
|
|
38228
38229
|
if (finalAppUrl) M.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
|
|
38229
38230
|
}
|
|
38230
38231
|
return {
|
|
@@ -38237,7 +38238,7 @@ async function executeCreate({ template, name: rawName, description, projectPath
|
|
|
38237
38238
|
}
|
|
38238
38239
|
};
|
|
38239
38240
|
}
|
|
38240
|
-
const createCommand = new Command("create").description("Create a new Base44 project").option("-n, --name <name>", "Project name").option("-d, --description <description>", "Project description").option("-p, --path <path>", "Path where to create the project").option("-t, --template <id>", "Template ID (e.g., backend-only, backend-and-client)").option("--deploy", "Build and deploy the site").hook("preAction", validateNonInteractiveFlags$
|
|
38241
|
+
const createCommand = new Command("create").description("Create a new Base44 project").option("-n, --name <name>", "Project name").option("-d, --description <description>", "Project description").option("-p, --path <path>", "Path where to create the project").option("-t, --template <id>", "Template ID (e.g., backend-only, backend-and-client)").option("--deploy", "Build and deploy the site").hook("preAction", validateNonInteractiveFlags$2).action(async (options) => {
|
|
38241
38242
|
await chooseCreate(options);
|
|
38242
38243
|
});
|
|
38243
38244
|
|
|
@@ -38783,12 +38784,12 @@ var open_default = open;
|
|
|
38783
38784
|
//#endregion
|
|
38784
38785
|
//#region src/cli/commands/project/dashboard.ts
|
|
38785
38786
|
async function openDashboard(options) {
|
|
38786
|
-
const dashboardUrl
|
|
38787
|
+
const dashboardUrl = getDashboardUrl();
|
|
38787
38788
|
const shouldOpen = !isJsonMode() && options.open !== false;
|
|
38788
|
-
if (shouldOpen) await open_default(dashboardUrl
|
|
38789
|
+
if (shouldOpen) await open_default(dashboardUrl);
|
|
38789
38790
|
return {
|
|
38790
|
-
outroMessage: shouldOpen ? `Dashboard opened at ${dashboardUrl
|
|
38791
|
-
data: { dashboardUrl
|
|
38791
|
+
outroMessage: shouldOpen ? `Dashboard opened at ${dashboardUrl}` : `Dashboard URL: ${dashboardUrl}`,
|
|
38792
|
+
data: { dashboardUrl }
|
|
38792
38793
|
};
|
|
38793
38794
|
}
|
|
38794
38795
|
const dashboardCommand = new Command("dashboard").description("Open the app dashboard in your browser").option("--no-open", "Print the URL without opening the browser").action(async (options) => {
|
|
@@ -38797,9 +38798,21 @@ const dashboardCommand = new Command("dashboard").description("Open the app dash
|
|
|
38797
38798
|
|
|
38798
38799
|
//#endregion
|
|
38799
38800
|
//#region src/cli/commands/project/deploy.ts
|
|
38801
|
+
function validateNonInteractiveFlags$1(command) {
|
|
38802
|
+
const opts = command.optsWithGlobals();
|
|
38803
|
+
if (opts.json && !opts.yes) command.error("JSON mode requires: --yes (-y) to skip confirmation");
|
|
38804
|
+
}
|
|
38800
38805
|
async function deployAction$1(options) {
|
|
38801
38806
|
const projectData = await readProjectConfig();
|
|
38802
|
-
if (!hasResourcesToDeploy(projectData)) return {
|
|
38807
|
+
if (!hasResourcesToDeploy(projectData)) return {
|
|
38808
|
+
outroMessage: "No resources found to deploy",
|
|
38809
|
+
data: {
|
|
38810
|
+
dashboardUrl: getDashboardUrl(),
|
|
38811
|
+
entitiesCount: 0,
|
|
38812
|
+
functionsCount: 0,
|
|
38813
|
+
siteDeployed: false
|
|
38814
|
+
}
|
|
38815
|
+
};
|
|
38803
38816
|
const { project, entities, functions } = projectData;
|
|
38804
38817
|
const summaryLines = [];
|
|
38805
38818
|
if (entities.length > 0) summaryLines.push(` - ${entities.length} ${entities.length === 1 ? "entity" : "entities"}`);
|
|
@@ -38808,19 +38821,40 @@ async function deployAction$1(options) {
|
|
|
38808
38821
|
if (!options.yes) {
|
|
38809
38822
|
M.warn(`This will update your Base44 app with:\n${summaryLines.join("\n")}`);
|
|
38810
38823
|
const shouldDeploy = await ye({ message: "Are you sure you want to continue?" });
|
|
38811
|
-
if (pD(shouldDeploy) || !shouldDeploy) return {
|
|
38812
|
-
|
|
38824
|
+
if (pD(shouldDeploy) || !shouldDeploy) return {
|
|
38825
|
+
outroMessage: "Deployment cancelled",
|
|
38826
|
+
data: {
|
|
38827
|
+
dashboardUrl: getDashboardUrl(),
|
|
38828
|
+
entitiesCount: entities.length,
|
|
38829
|
+
functionsCount: functions.length,
|
|
38830
|
+
siteDeployed: false,
|
|
38831
|
+
cancelled: true
|
|
38832
|
+
}
|
|
38833
|
+
};
|
|
38834
|
+
} else if (!isJsonMode()) M.info(`Deploying:\n${summaryLines.join("\n")}`);
|
|
38813
38835
|
const result = await runTask("Deploying your app...", async () => {
|
|
38814
38836
|
return await deployAll(projectData);
|
|
38815
38837
|
}, {
|
|
38816
38838
|
successMessage: theme.colors.base44Orange("Deployment completed"),
|
|
38817
38839
|
errorMessage: "Deployment failed"
|
|
38818
38840
|
});
|
|
38819
|
-
|
|
38820
|
-
if (
|
|
38821
|
-
|
|
38841
|
+
const dashboardUrl = getDashboardUrl();
|
|
38842
|
+
if (!isJsonMode()) {
|
|
38843
|
+
M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(dashboardUrl)}`);
|
|
38844
|
+
if (result.appUrl) M.message(`${theme.styles.header("App URL")}: ${theme.colors.links(result.appUrl)}`);
|
|
38845
|
+
}
|
|
38846
|
+
return {
|
|
38847
|
+
outroMessage: "App deployed successfully",
|
|
38848
|
+
data: {
|
|
38849
|
+
dashboardUrl,
|
|
38850
|
+
appUrl: result.appUrl,
|
|
38851
|
+
entitiesCount: entities.length,
|
|
38852
|
+
functionsCount: functions.length,
|
|
38853
|
+
siteDeployed: !!project.site?.outputDirectory
|
|
38854
|
+
}
|
|
38855
|
+
};
|
|
38822
38856
|
}
|
|
38823
|
-
const deployCommand = new Command("deploy").description("Deploy all project resources (entities, functions, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
|
|
38857
|
+
const deployCommand = new Command("deploy").description("Deploy all project resources (entities, functions, and site)").option("-y, --yes", "Skip confirmation prompt").hook("preAction", validateNonInteractiveFlags$1).action(async (options) => {
|
|
38824
38858
|
await runCommand(() => deployAction$1(options), { requireAuth: true });
|
|
38825
38859
|
});
|
|
38826
38860
|
|
|
@@ -38880,7 +38914,8 @@ async function link(options) {
|
|
|
38880
38914
|
id: projectId,
|
|
38881
38915
|
projectRoot: projectRoot.root
|
|
38882
38916
|
});
|
|
38883
|
-
|
|
38917
|
+
const dashboardUrl = getDashboardUrl(projectId);
|
|
38918
|
+
if (!isJsonMode()) M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(dashboardUrl)}`);
|
|
38884
38919
|
return {
|
|
38885
38920
|
outroMessage: "Project linked",
|
|
38886
38921
|
data: {
|
package/package.json
CHANGED