Skip to content

feat(functions): add functions delete command#381

Merged
yardend-wix merged 6 commits intofeature/functions-commandsfrom
feature/functions-delete-command
Mar 12, 2026
Merged

feat(functions): add functions delete command#381
yardend-wix merged 6 commits intofeature/functions-commandsfrom
feature/functions-delete-command

Conversation

@yardend-wix
Copy link
Contributor

@yardend-wix yardend-wix commented Mar 8, 2026

Note

Description

Adds a base44 functions delete <names...> subcommand that deletes one or more deployed backend functions by name. Each function deletion runs as an individual task spinner, with a bulk summary outro for multi-name invocations. The command handles 404 responses gracefully (reports "not found" rather than erroring) and supports both space-separated variadic args and comma-separated names (e.g. functions delete func-a,func-b).

Related Issue

None

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • Added packages/cli/src/cli/commands/functions/delete.ts — new delete subcommand with per-name task spinners, graceful 404 handling, comma-separated name parsing, and a bulk summary outro
  • Updated packages/cli/src/cli/commands/functions/index.ts — registers getDeleteCommand alongside deploy and list under the functions command group
  • Added deleteSingleFunction(name) to packages/cli/src/core/resources/function/api.ts — issues DELETE backend-functions/:name via the app client with ApiError.fromHttpError() error wrapping
  • Added packages/cli/tests/cli/functions_delete.spec.ts — 5 integration test cases: single delete, multi-delete summary, 404 not-found, 500 error handling, and unauthenticated/no-project failure
  • Extended TestAPIServer in the testkit with mockSingleFunctionDelete() and mockSingleFunctionDeleteError() mock route helpers

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated docs/ (AGENTS.md) if I made architectural changes

Additional Notes

The delete command differentiates between missing functions (404) and unexpected API errors in both per-task output and the exit summary. Input validation rejects invocations with no names after parsing, and the preAction hook ensures the error is surfaced before the action runs.


🤖 Generated by Claude | 2026-03-12 14:04 UTC

@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.44-pr.381.3470954

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.0.44-pr.381.3470954"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.44-pr.381.3470954"
  }
}

Preview published to npm registry — try new features instantly!

yardend-wix and others added 2 commits March 9, 2026 11:38
Add a new `functions delete` CLI command that deletes one or more
deployed functions by name. Handles 404 (not found) gracefully and
supports comma-separated name arguments.

- Add deleteSingleFunction API client function
- Create parseNames utility for variadic CLI args
- Create functions/delete.ts command with multi-name support
- Refactor functions command group with index.ts
- Add test mocks and 5 tests for the delete command

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yardend-wix yardend-wix force-pushed the feature/functions-delete-command branch from 81eefba to a79cebb Compare March 9, 2026 09:40
@github-project-automation github-project-automation bot moved this from Backlog to Ready in CLI Development Mar 9, 2026
yardend-wix and others added 2 commits March 10, 2026 17:11
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Move parseNames inline into delete.ts, remove separate utility file
- Add preAction hook for input validation (following link.ts/create.ts pattern)
- Wrap each deletion in runTask for spinner UX
- Update test expectations to match new output

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kfirstri kfirstri moved this from Ready to In review in CLI Development Mar 11, 2026
@yardend-wix yardend-wix changed the base branch from main to feature/functions-commands March 12, 2026 10:27
Combines delete command mocks with list command mocks in TestAPIServer,
and registers all three subcommands (deploy, delete, list) in index.ts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yardend-wix yardend-wix merged commit 6d50f57 into feature/functions-commands Mar 12, 2026
4 checks passed
@yardend-wix yardend-wix deleted the feature/functions-delete-command branch March 12, 2026 14:07
@github-project-automation github-project-automation bot moved this from In review to Done in CLI Development Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants