base44 0.0.16 → 0.0.17

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/README.md CHANGED
@@ -58,15 +58,15 @@ base44 link
58
58
  base44 link --create --name "my-app" --description "My app description"
59
59
 
60
60
  # Link to an existing project by ID (non-interactive)
61
- base44 link --existing <app-id>
61
+ base44 link --projectId <app-id>
62
62
  ```
63
63
 
64
64
  | Option | Description |
65
65
  |--------|-------------|
66
66
  | `-c, --create` | Create a new project (skip selection prompt) |
67
- | `-e, --existing <id>` | Link to an existing project by ID |
68
67
  | `-n, --name <name>` | Project name (required with --create) |
69
68
  | `-d, --description <desc>` | Project description (optional) |
69
+ | `-p, --projectId <id>` | Link to an existing project by ID (skips selection prompt) |
70
70
 
71
71
  ### Deployment
72
72
 
package/dist/cli/index.js CHANGED
@@ -16798,7 +16798,10 @@ async function createProject(projectName, description) {
16798
16798
  return { projectId: CreateProjectResponseSchema.parse(await response.json()).id };
16799
16799
  }
16800
16800
  async function listProjects() {
16801
- const response = await base44Client.get(`api/apps?sort=-updated_date&fields=id,name,user_description,is_managed_source_code`);
16801
+ const response = await base44Client.get(`api/apps`, { searchParams: {
16802
+ "sort": "-updated_date",
16803
+ "fields": "id,name,user_description,is_managed_source_code"
16804
+ } });
16802
16805
  return ProjectsResponseSchema.parse(await response.json());
16803
16806
  }
16804
16807
 
@@ -38754,9 +38757,8 @@ const deployCommand = new Command("deploy").description("Deploy all project reso
38754
38757
  //#endregion
38755
38758
  //#region src/cli/commands/project/link.ts
38756
38759
  function validateNonInteractiveFlags(command) {
38757
- const { create: create$1, name: name$1, existing, projectId } = command.opts();
38758
- if (create$1 && existing) command.error("--create and --existing cannot be used together");
38759
- if (existing && !projectId) command.error("--projectId is required when using --existing");
38760
+ const { create: create$1, name: name$1, projectId } = command.opts();
38761
+ if (create$1 && projectId) command.error("--create and --projectId cannot be used together");
38760
38762
  if (create$1 && !name$1) command.error("--name is required when using --create");
38761
38763
  }
38762
38764
  async function promptForLinkAction() {
@@ -38820,14 +38822,18 @@ async function link(options) {
38820
38822
  if (!projectRoot) throw new Error("No Base44 project found. Run this command from a project directory with a config.jsonc file.");
38821
38823
  if (await appConfigExists(projectRoot.root)) throw new Error("Project is already linked. An .app.jsonc file with the appId already exists.");
38822
38824
  let finalProjectId;
38823
- const action = options.existing ? "choose" : options.create ? "create" : await promptForLinkAction();
38825
+ const action = options.projectId ? "choose" : options.create ? "create" : await promptForLinkAction();
38824
38826
  if (action === "choose") {
38825
38827
  const linkableProjects = (await runTask("Fetching projects...", async () => listProjects(), {
38826
38828
  successMessage: "Projects fetched",
38827
38829
  errorMessage: "Failed to fetch projects"
38828
38830
  })).filter((p$1) => p$1.isManagedSourceCode !== true);
38829
38831
  if (!linkableProjects.length) return { outroMessage: "No projects available for linking" };
38830
- const { id: projectId } = options.existing ? { id: options.projectId } : await promptForExistingProject(linkableProjects);
38832
+ let projectId;
38833
+ if (options.projectId) {
38834
+ if (!linkableProjects.find((p$1) => p$1.id === options.projectId)) throw new Error(`Project with ID "${options.projectId}" not found or not available for linking.`);
38835
+ projectId = options.projectId;
38836
+ } else projectId = (await promptForExistingProject(linkableProjects)).id;
38831
38837
  await runTask("Linking project...", async () => {
38832
38838
  await writeAppConfig(projectRoot.root, projectId);
38833
38839
  setAppConfig({
@@ -38861,7 +38867,7 @@ async function link(options) {
38861
38867
  M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(finalProjectId))}`);
38862
38868
  return { outroMessage: "Project linked" };
38863
38869
  }
38864
- const linkCommand = new Command("link").description("Link a local project to a Base44 project (create new or link existing)").option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").option("-e, --existing", "Link to an existing project (skip selection prompt)").option("-p, --projectId <id>", "Project ID (required when --existing is used)").hook("preAction", validateNonInteractiveFlags).action(async (options) => {
38870
+ const linkCommand = new Command("link").description("Link a local project to a Base44 project (create new or link existing)").option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").option("-p, --projectId <id>", "Project ID to link to an existing project (skips selection prompt)").hook("preAction", validateNonInteractiveFlags).action(async (options) => {
38865
38871
  await runCommand(() => link(options), {
38866
38872
  requireAuth: true,
38867
38873
  requireAppConfig: false
@@ -38891,7 +38897,7 @@ const siteDeployCommand = new Command("site").description("Manage site deploymen
38891
38897
 
38892
38898
  //#endregion
38893
38899
  //#region package.json
38894
- var version = "0.0.16";
38900
+ var version = "0.0.17";
38895
38901
 
38896
38902
  //#endregion
38897
38903
  //#region src/cli/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "base44",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "description": "Base44 CLI - Unified interface for managing Base44 applications",
5
5
  "type": "module",
6
6
  "main": "./dist/cli/index.js",