Skip to content

fix(device): keep a missing --text on type inside the --json envelope - #311

Merged
finalerock44 merged 1 commit into
devfrom
fix/device-type-text-envelope
Nov 11, 2026
Merged

finalerock44 merged 1 commit into
devfrom
fix/device-type-text-envelope

Conversation

@finalerock44

Copy link
Copy Markdown
Contributor

type --text was marked required, so citty rejected a missing value before runDeviceCommand ran, and --json then printed the top-level { status, error } instead of the device envelope the command promises. The flag is optional now; the command's own check answers the usage error (exit 1) inside the envelope.

What & why

Type of change

  • fix — bug fix
  • feat — new feature
  • perf — performance improvement
  • refactor — code change that's neither a fix nor a feature
  • docs — documentation only
  • chore / ci / build / test — tooling, no user-facing change
  • Breaking change (title has ! or PR notes a BREAKING CHANGE:)

Checklist

  • PR title follows the Conventional Commits format (see comment above)
  • pnpm lint passes
  • pnpm typecheck passes
  • pnpm build passes
  • I have not bumped the version or edited CHANGELOG.md (the release workflow handles this)
  • I have signed the CLA (the bot will prompt on first contribution)
  • Docs / README.md / STYLE_GUIDE.md updated if behaviour or output changed

How to test

`type --text` was marked required, so citty rejected a missing value
before runDeviceCommand ran, and --json then printed the top-level
{ status, error } instead of the device envelope the command promises.
The flag is optional now; the command's own check answers the usage error
(exit 1) inside the envelope.
@finalerock44 finalerock44 self-assigned this Nov 11, 2026
@claude

claude Bot commented Nov 11, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

This is a small change and it is correct. Dropping required: true from type --text lets the existing if (!text) throw new CliError('--text must not be empty.', 1) check inside runDeviceCommand handle a missing value, so the error stays inside the { ok, session, data, error } envelope with exit code 1 (usage), as CLAUDE.md requires for dcd device. No other dcd device subcommand still uses required: true.

🤖 Generated with Claude Code

@finalerock44
finalerock44 merged commit 9f16ca2 into dev Nov 11, 2026
9 checks passed
@finalerock44
finalerock44 deleted the fix/device-type-text-envelope branch November 11, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant