@base44-preview/cli 0.0.24-pr.146.e5ee77a → 0.0.25-pr.149.141ed92

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.
Files changed (2) hide show
  1. package/dist/index.js +39 -10
  2. package/package.json +8 -2
package/dist/index.js CHANGED
@@ -16889,6 +16889,11 @@ async function writeAgents(agentsDir, remoteAgents) {
16889
16889
  //#endregion
16890
16890
  //#region src/core/resources/agent/api.ts
16891
16891
  async function pushAgents(agents) {
16892
+ if (agents.length === 0) return {
16893
+ created: [],
16894
+ updated: [],
16895
+ deleted: []
16896
+ };
16892
16897
  const response = await getAppClient().put("agent-configs", {
16893
16898
  json: agents,
16894
16899
  throwHttpErrors: false
@@ -30612,25 +30617,27 @@ async function createArchive(pathToArchive, targetArchivePath) {
30612
30617
  * Checks if there are any resources to deploy in the project.
30613
30618
  *
30614
30619
  * @param projectData - The project configuration and resources
30615
- * @returns true if there are entities, functions, or a configured site to deploy
30620
+ * @returns true if there are entities, functions, agents, or a configured site to deploy
30616
30621
  */
30617
30622
  function hasResourcesToDeploy(projectData) {
30618
- const { project, entities, functions } = projectData;
30623
+ const { project, entities, functions, agents } = projectData;
30619
30624
  const hasSite = Boolean(project.site?.outputDirectory);
30620
30625
  const hasEntities = entities.length > 0;
30621
30626
  const hasFunctions = functions.length > 0;
30622
- return hasEntities || hasFunctions || hasSite;
30627
+ const hasAgents = agents.length > 0;
30628
+ return hasEntities || hasFunctions || hasAgents || hasSite;
30623
30629
  }
30624
30630
  /**
30625
- * Deploys all project resources (entities, functions, and site) to Base44.
30631
+ * Deploys all project resources (entities, functions, agents, and site) to Base44.
30626
30632
  *
30627
30633
  * @param projectData - The project configuration and resources to deploy
30628
30634
  * @returns The deployment result including app URL if site was deployed
30629
30635
  */
30630
30636
  async function deployAll(projectData) {
30631
- const { project, entities, functions } = projectData;
30637
+ const { project, entities, functions, agents } = projectData;
30632
30638
  await entityResource.push(entities);
30633
30639
  await functionResource.push(functions);
30640
+ await agentResource.push(agents);
30634
30641
  if (project.site?.outputDirectory) {
30635
30642
  const { appUrl } = await deploySite(resolve(project.root, project.site.outputDirectory));
30636
30643
  return { appUrl };
@@ -30642,11 +30649,31 @@ async function deployAll(projectData) {
30642
30649
  //#region src/core/project/app-config.ts
30643
30650
  let cache = null;
30644
30651
  /**
30652
+ * Load app config from BASE44_CLI_TEST_OVERRIDES env var.
30653
+ * @returns true if override was applied, false otherwise
30654
+ */
30655
+ function loadFromTestOverrides() {
30656
+ const overrides = process.env.BASE44_CLI_TEST_OVERRIDES;
30657
+ if (!overrides) return false;
30658
+ try {
30659
+ const data = JSON.parse(overrides);
30660
+ if (data.appConfig?.id && data.appConfig?.projectRoot) {
30661
+ cache = {
30662
+ id: data.appConfig.id,
30663
+ projectRoot: data.appConfig.projectRoot
30664
+ };
30665
+ return true;
30666
+ }
30667
+ } catch {}
30668
+ return false;
30669
+ }
30670
+ /**
30645
30671
  * Initialize app config by reading from .app.jsonc.
30646
30672
  * Must be called before using getAppConfig().
30647
30673
  * @throws Error if no project found or .app.jsonc missing
30648
30674
  */
30649
30675
  async function initAppConfig() {
30676
+ if (loadFromTestOverrides()) return;
30650
30677
  if (cache) return;
30651
30678
  const projectRoot = await findProjectRoot();
30652
30679
  if (!projectRoot) throw new Error("No Base44 project found. Run this command from a project directory with a config.jsonc file.");
@@ -31595,7 +31622,8 @@ const logoutCommand = new Command("logout").description("Logout from current dev
31595
31622
  async function pushEntitiesAction() {
31596
31623
  const { entities } = await readProjectConfig();
31597
31624
  if (entities.length === 0) return { outroMessage: "No entities found in project" };
31598
- M.info(`Found ${entities.length} entities to push`);
31625
+ const entityNames = entities.map((e$1) => e$1.name).join(", ");
31626
+ M.info(`Found ${entities.length} entities to push: ${entityNames}`);
31599
31627
  const result = await runTask("Pushing entities to Base44", async () => {
31600
31628
  return await pushEntities(entities);
31601
31629
  }, {
@@ -39058,7 +39086,7 @@ var open_default = open;
39058
39086
  //#region src/cli/commands/project/dashboard.ts
39059
39087
  async function openDashboard() {
39060
39088
  const dashboardUrl = getDashboardUrl();
39061
- await open_default(dashboardUrl);
39089
+ if (!process.env.CI) await open_default(dashboardUrl);
39062
39090
  return { outroMessage: `Dashboard opened at ${dashboardUrl}` };
39063
39091
  }
39064
39092
  const dashboardCommand = new Command("dashboard").description("Open the app dashboard in your browser").action(async () => {
@@ -39070,10 +39098,11 @@ const dashboardCommand = new Command("dashboard").description("Open the app dash
39070
39098
  async function deployAction$1(options) {
39071
39099
  const projectData = await readProjectConfig();
39072
39100
  if (!hasResourcesToDeploy(projectData)) return { outroMessage: "No resources found to deploy" };
39073
- const { project, entities, functions } = projectData;
39101
+ const { project, entities, functions, agents } = projectData;
39074
39102
  const summaryLines = [];
39075
39103
  if (entities.length > 0) summaryLines.push(` - ${entities.length} ${entities.length === 1 ? "entity" : "entities"}`);
39076
39104
  if (functions.length > 0) summaryLines.push(` - ${functions.length} ${functions.length === 1 ? "function" : "functions"}`);
39105
+ if (agents.length > 0) summaryLines.push(` - ${agents.length} ${agents.length === 1 ? "agent" : "agents"}`);
39077
39106
  if (project.site?.outputDirectory) summaryLines.push(` - Site from ${project.site.outputDirectory}`);
39078
39107
  if (!options.yes) {
39079
39108
  M.warn(`This will update your Base44 app with:\n${summaryLines.join("\n")}`);
@@ -39090,7 +39119,7 @@ async function deployAction$1(options) {
39090
39119
  if (result.appUrl) M.message(`${theme.styles.header("App URL")}: ${theme.colors.links(result.appUrl)}`);
39091
39120
  return { outroMessage: "App deployed successfully" };
39092
39121
  }
39093
- const deployCommand = new Command("deploy").description("Deploy all project resources (entities, functions, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
39122
+ const deployCommand = new Command("deploy").description("Deploy all project resources (entities, functions, agents, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
39094
39123
  await runCommand(() => deployAction$1(options), { requireAuth: true });
39095
39124
  });
39096
39125
 
@@ -39237,7 +39266,7 @@ const siteDeployCommand = new Command("site").description("Manage site deploymen
39237
39266
 
39238
39267
  //#endregion
39239
39268
  //#region package.json
39240
- var version = "0.0.24";
39269
+ var version = "0.0.25";
39241
39270
 
39242
39271
  //#endregion
39243
39272
  //#region src/cli/program.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/cli",
3
- "version": "0.0.24-pr.146.e5ee77a",
3
+ "version": "0.0.25-pr.149.141ed92",
4
4
  "description": "Base44 CLI - Unified interface for managing Base44 applications",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,7 +16,7 @@
16
16
  "dev": "./bin/dev.js",
17
17
  "start": "./bin/run.js",
18
18
  "clean": "rm -rf dist",
19
- "lint": "eslint src",
19
+ "lint": "eslint src tests",
20
20
  "test": "vitest run",
21
21
  "test:watch": "vitest"
22
22
  },
@@ -52,9 +52,12 @@
52
52
  "json5": "^2.2.3",
53
53
  "ky": "^1.14.2",
54
54
  "lodash.kebabcase": "^4.1.1",
55
+ "msw": "^2.12.7",
55
56
  "open": "^11.0.0",
56
57
  "p-wait-for": "^6.0.0",
58
+ "strip-ansi": "^7.1.2",
57
59
  "tar": "^7.5.4",
60
+ "tmp-promise": "^3.0.3",
58
61
  "tsdown": "^0.12.4",
59
62
  "tsx": "^4.19.2",
60
63
  "typescript": "^5.7.2",
@@ -64,5 +67,8 @@
64
67
  },
65
68
  "engines": {
66
69
  "node": ">=20.19.0"
70
+ },
71
+ "optionalDependencies": {
72
+ "@rollup/rollup-linux-x64-gnu": "^4.56.0"
67
73
  }
68
74
  }