@base44-preview/cli 0.0.53-pr.534.4cbec83 → 0.0.54-pr.536.1c139b6

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
@@ -243793,7 +243793,7 @@ import { join as join10 } from "node:path";
243793
243793
  // package.json
243794
243794
  var package_default = {
243795
243795
  name: "base44",
243796
- version: "0.0.53",
243796
+ version: "0.0.54",
243797
243797
  description: "Base44 CLI - Unified interface for managing Base44 applications",
243798
243798
  type: "module",
243799
243799
  bin: {
@@ -252869,8 +252869,11 @@ function getFunctionsCommand() {
252869
252869
  }
252870
252870
 
252871
252871
  // src/cli/commands/project/create.ts
252872
- import { basename as basename3, join as join20, resolve as resolve5 } from "node:path";
252872
+ import { basename as basename3, resolve as resolve5 } from "node:path";
252873
252873
  var import_kebabCase = __toESM(require_kebabCase(), 1);
252874
+
252875
+ // src/cli/commands/project/scaffold-shared.ts
252876
+ import { join as join20 } from "node:path";
252874
252877
  var DEFAULT_TEMPLATE_ID = "backend-only";
252875
252878
  async function getTemplateById(templateId) {
252876
252879
  const templates = await listTemplates();
@@ -252883,6 +252886,88 @@ async function getTemplateById(templateId) {
252883
252886
  }
252884
252887
  return template2;
252885
252888
  }
252889
+ async function completeProjectSetup({
252890
+ projectId,
252891
+ name: name2,
252892
+ resolvedPath,
252893
+ deploy: deploy5,
252894
+ skills,
252895
+ isInteractive
252896
+ }, { runTask: runTask2 }) {
252897
+ const { project: project2, entities } = await readProjectConfig(resolvedPath);
252898
+ let finalAppUrl;
252899
+ if (entities.length > 0) {
252900
+ let shouldPushEntities;
252901
+ if (isInteractive) {
252902
+ const result = await Re({
252903
+ message: "Set up the backend data now? (This pushes the data models used by the template to Base44)"
252904
+ });
252905
+ shouldPushEntities = !Ct(result) && result;
252906
+ } else {
252907
+ shouldPushEntities = !!deploy5;
252908
+ }
252909
+ if (shouldPushEntities) {
252910
+ await runTask2(`Pushing ${entities.length} data models to Base44...`, async () => {
252911
+ await pushEntities(entities);
252912
+ }, {
252913
+ successMessage: theme.colors.base44Orange("Data models pushed successfully"),
252914
+ errorMessage: "Failed to push data models"
252915
+ });
252916
+ }
252917
+ }
252918
+ if (project2.site) {
252919
+ const { installCommand, buildCommand, outputDirectory } = project2.site;
252920
+ let shouldDeploy;
252921
+ if (isInteractive) {
252922
+ const result = await Re({
252923
+ message: "Would you like to deploy the site now? (Hosted on Base44)"
252924
+ });
252925
+ shouldDeploy = !Ct(result) && result;
252926
+ } else {
252927
+ shouldDeploy = !!deploy5;
252928
+ }
252929
+ if (shouldDeploy && installCommand && buildCommand && outputDirectory) {
252930
+ const { appUrl } = await runTask2("Installing dependencies...", async (updateMessage) => {
252931
+ await execa({ cwd: resolvedPath, shell: true })`${installCommand}`;
252932
+ updateMessage("Building project...");
252933
+ await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
252934
+ updateMessage("Deploying site...");
252935
+ return await deploySite(join20(resolvedPath, outputDirectory));
252936
+ }, {
252937
+ successMessage: theme.colors.base44Orange("Site deployed successfully"),
252938
+ errorMessage: "Failed to deploy site"
252939
+ });
252940
+ finalAppUrl = appUrl;
252941
+ }
252942
+ }
252943
+ if (skills) {
252944
+ try {
252945
+ await runTask2("Installing AI agent skills...", async () => {
252946
+ await execa("npx", ["-y", "skills", "add", "base44/skills", "-y"], {
252947
+ cwd: resolvedPath,
252948
+ shell: true
252949
+ });
252950
+ }, {
252951
+ successMessage: theme.colors.base44Orange("AI agent skills added successfully"),
252952
+ errorMessage: "Failed to add AI agent skills - you can add them later with: npx skills add base44/skills"
252953
+ });
252954
+ } catch {}
252955
+ }
252956
+ return {
252957
+ name: name2,
252958
+ dashboardUrl: getDashboardUrl(projectId),
252959
+ appUrl: finalAppUrl
252960
+ };
252961
+ }
252962
+ function printProjectSummary({ name: name2, dashboardUrl, appUrl }, log) {
252963
+ log.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name2)}`);
252964
+ log.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(dashboardUrl)}`);
252965
+ if (appUrl) {
252966
+ log.message(`${theme.styles.header("Site")}: ${theme.colors.links(appUrl)}`);
252967
+ }
252968
+ }
252969
+
252970
+ // src/cli/commands/project/create.ts
252886
252971
  function validateNonInteractiveFlags(command2) {
252887
252972
  const { path: path17 } = command2.opts();
252888
252973
  if (path17 && !command2.args.length) {
@@ -252953,7 +253038,8 @@ async function executeCreate({
252953
253038
  deploy: deploy5,
252954
253039
  skills,
252955
253040
  isInteractive
252956
- }, { log, runTask: runTask2 }) {
253041
+ }, ctx) {
253042
+ const { log, runTask: runTask2 } = ctx;
252957
253043
  const name2 = rawName.trim();
252958
253044
  const resolvedPath = resolve5(projectPath);
252959
253045
  const { projectId } = await runTask2("Setting up your project...", async () => {
@@ -252968,79 +253054,16 @@ async function executeCreate({
252968
253054
  errorMessage: "Failed to create project"
252969
253055
  });
252970
253056
  setAppConfig({ id: projectId, projectRoot: resolvedPath });
252971
- const { project: project2, entities } = await readProjectConfig(resolvedPath);
252972
- let finalAppUrl;
252973
- if (entities.length > 0) {
252974
- let shouldPushEntities;
252975
- if (isInteractive) {
252976
- const result = await Re({
252977
- message: "Set up the backend data now? (This pushes the data models used by the template to Base44)"
252978
- });
252979
- shouldPushEntities = !Ct(result) && result;
252980
- } else {
252981
- shouldPushEntities = !!deploy5;
252982
- }
252983
- if (shouldPushEntities) {
252984
- await runTask2(`Pushing ${entities.length} data models to Base44...`, async () => {
252985
- await pushEntities(entities);
252986
- }, {
252987
- successMessage: theme.colors.base44Orange("Data models pushed successfully"),
252988
- errorMessage: "Failed to push data models"
252989
- });
252990
- }
252991
- }
252992
- if (project2.site) {
252993
- const { installCommand, buildCommand, outputDirectory } = project2.site;
252994
- let shouldDeploy;
252995
- if (isInteractive) {
252996
- const result = await Re({
252997
- message: "Would you like to deploy the site now? (Hosted on Base44)"
252998
- });
252999
- shouldDeploy = !Ct(result) && result;
253000
- } else {
253001
- shouldDeploy = !!deploy5;
253002
- }
253003
- if (shouldDeploy && installCommand && buildCommand && outputDirectory) {
253004
- const { appUrl } = await runTask2("Installing dependencies...", async (updateMessage) => {
253005
- await execa({ cwd: resolvedPath, shell: true })`${installCommand}`;
253006
- updateMessage("Building project...");
253007
- await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
253008
- updateMessage("Deploying site...");
253009
- return await deploySite(join20(resolvedPath, outputDirectory));
253010
- }, {
253011
- successMessage: theme.colors.base44Orange("Site deployed successfully"),
253012
- errorMessage: "Failed to deploy site"
253013
- });
253014
- finalAppUrl = appUrl;
253015
- }
253016
- }
253017
- const shouldAddSkills = skills;
253018
- if (shouldAddSkills) {
253019
- try {
253020
- await runTask2("Installing AI agent skills...", async () => {
253021
- await execa("npx", ["-y", "skills", "add", "base44/skills", "-y"], {
253022
- cwd: resolvedPath,
253023
- shell: true
253024
- });
253025
- }, {
253026
- successMessage: theme.colors.base44Orange("AI agent skills added successfully"),
253027
- errorMessage: "Failed to add AI agent skills - you can add them later with: npx skills add base44/skills"
253028
- });
253029
- } catch {}
253030
- }
253031
- log.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name2)}`);
253032
- log.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(projectId))}`);
253033
- if (finalAppUrl) {
253034
- log.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
253035
- }
253057
+ const summary = await completeProjectSetup({ projectId, name: name2, resolvedPath, deploy: deploy5, skills, isInteractive }, ctx);
253058
+ printProjectSummary(summary, log);
253036
253059
  return { outroMessage: "Your project is set up and ready to use" };
253037
253060
  }
253038
- async function createAction({ log, runTask: runTask2, isNonInteractive }, name2, options) {
253061
+ async function createAction(ctx, name2, options) {
253039
253062
  if (name2 && !options.path) {
253040
253063
  options.path = `./${import_kebabCase.default(name2)}`;
253041
253064
  }
253042
253065
  const skipPrompts = !!(options.name ?? name2) && !!options.path;
253043
- if (!skipPrompts && isNonInteractive) {
253066
+ if (!skipPrompts && ctx.isNonInteractive) {
253044
253067
  throw new InvalidInputError("Project name and --path are required in non-interactive mode", {
253045
253068
  hints: [
253046
253069
  {
@@ -253049,7 +253072,6 @@ async function createAction({ log, runTask: runTask2, isNonInteractive }, name2,
253049
253072
  ]
253050
253073
  });
253051
253074
  }
253052
- const ctx = { log, runTask: runTask2 };
253053
253075
  if (skipPrompts) {
253054
253076
  return await createNonInteractive({ name: options.name ?? name2, ...options }, ctx);
253055
253077
  }
@@ -261582,4 +261604,4 @@ export {
261582
261604
  CLIExitError
261583
261605
  };
261584
261606
 
261585
- //# debugId=1130AE2F3DFC8E3264756E2164756E21
261607
+ //# debugId=95AD9CC34F970E8B64756E2164756E21