@base44-preview/cli 0.0.53-pr.534.4cbec83 → 0.0.54-pr.536.bc33f35

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,82 @@ 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
+ }, { log, 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
+ log.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name2)}`);
252957
+ log.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(projectId))}`);
252958
+ if (finalAppUrl) {
252959
+ log.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
252960
+ }
252961
+ return { outroMessage: "Your project is set up and ready to use" };
252962
+ }
252963
+
252964
+ // src/cli/commands/project/create.ts
252886
252965
  function validateNonInteractiveFlags(command2) {
252887
252966
  const { path: path17 } = command2.opts();
252888
252967
  if (path17 && !command2.args.length) {
@@ -252968,72 +253047,7 @@ async function executeCreate({
252968
253047
  errorMessage: "Failed to create project"
252969
253048
  });
252970
253049
  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
- }
253036
- return { outroMessage: "Your project is set up and ready to use" };
253050
+ return await completeProjectSetup({ projectId, name: name2, resolvedPath, deploy: deploy5, skills, isInteractive }, { log, runTask: runTask2 });
253037
253051
  }
253038
253052
  async function createAction({ log, runTask: runTask2, isNonInteractive }, name2, options) {
253039
253053
  if (name2 && !options.path) {
@@ -261582,4 +261596,4 @@ export {
261582
261596
  CLIExitError
261583
261597
  };
261584
261598
 
261585
- //# debugId=1130AE2F3DFC8E3264756E2164756E21
261599
+ //# debugId=16995315964274D664756E2164756E21