Skip to content

CLI: emit [] on stdout when site list --format=json finds no sites - #3220

Merged
nightnei merged 1 commit into
trunkfrom
fix-site-list-json-empty-array
Apr 28, 2026
Merged

CLI: emit [] on stdout when site list --format=json finds no sites#3220
nightnei merged 1 commit into
trunkfrom
fix-site-list-json-empty-array

Conversation

@nightnei

@nightnei nightnei commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

How AI was used in this PR

Claude wrote the fix and the corresponding test. I reviewed and tested locally.

Proposed Changes

NIT: studio site list --format=json returned early with no stdout output when zero sites were configured, so a scripted consumer received empty input and errored trying to parse it. Now the command emits [], matching the contract of the non-empty case.

Testing Instructions

  1. Visual review should suffice, but:
  2. npm run cli:build
  3. Remove all sites
  4. node apps/cli/dist/cli/main.mjs site list --format=json
  5. Assert that you see an empty array - []
  6. node apps/cli/dist/cli/main.mjs site list
  7. Assert that no regressions and you still see only ✔ No sites found
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@nightnei
nightnei requested a review from a team April 23, 2026 21:14
@nightnei nightnei self-assigned this Apr 23, 2026
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing e89bc27 vs trunk

app-size

Metric trunk e89bc27 Diff Change
App Size (Mac) 1483.73 MB 1483.73 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk e89bc27 Diff Change
load 1798 ms 1931 ms +133 ms 🔴 7.4%

site-startup

Metric trunk e89bc27 Diff Change
siteCreation 8084 ms 8087 ms +3 ms ⚪ 0.0%
siteStartup 4961 ms 4949 ms 12 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@fredrikekelund fredrikekelund left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense 👍

@nightnei
nightnei merged commit 13a2424 into trunk Apr 28, 2026
12 checks passed
@nightnei
nightnei deleted the fix-site-list-json-empty-array branch April 28, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants