Skip to content

refactor: declare tg chats list output once (#179) - #188

Merged
neoromantic merged 3 commits into
mainfrom
land/179-output-declaration
Nov 18, 2026
Merged

neoromantic merged 3 commits into
mainfrom
land/179-output-declaration

Conversation

@neoromantic

Copy link
Copy Markdown
Owner

What and why

Lands #179 (one output declaration for tg chats list, the trial asked for in #160) on the current main. This branch is its head af70cb3, unchanged, plus a merge of it into main. It is merged with a merge commit, so the original commit and its author stay in history and #179 closes as merged.

The merge commit resolves one semantic conflict with #176: nextChatsPage in src/commands/chats/list.ts typed its argument as PaginatedResult, whose import #179 removed. It now takes ChatsListOutput.

One docs commit adds bun run docs:outputs to AGENTS.md, a note on where tg chats list declares its data, and a ### Changed entry in the changelog.

Scope stays the trial: only tg chats list; no other command moves to declarations.

How I checked it

  • bun run check: clean. bun run test: 2347 pass, 0 fail. bun run test:e2e: 454 pass, 0 fail. bun run build: dist/tg lists chats from a made-up cache without credentials. bun run docs:outputs leaves docs/cli-commands.md unchanged.

  • Output unchanged: on a made-up cache, main and this branch print byte-identical stdout and stderr for chats list with no flags, --limit 2 (with next), --limit 2 --type supergroup, --unread, --limit 0, and --format pretty with and without --limit 2.

  • zod does not ship: the bundles of main and this branch contain the same modules; no zod and no list-output.ts in dist/tg. The CLI imports only types from the declaration.

  • Drift is caught: spreading an extra isPinned into each item passes tsc, and the new e2e test fails with items.0: Unrecognized key: "isPinned" (one line per item). Changing a field description without bun run docs:outputs fails src/__tests__/docs-outputs.test.ts with the table row diff.

  • Tests pass locally and use made-up data only

  • README, docs and affected demos follow the product content standard

  • Title follows Conventional Commits

🤖 Generated with Claude Code

ertembiyik and others added 3 commits November 18, 2026 08:58
A trial of one output declaration on one command. The data that
tg chats list prints is a zod schema with a description per field; its
types are inferred from it, the field table in docs/cli-commands.md is
generated from it, and an e2e test parses the real output strictly
against it. zod is a devDependency: the command imports only the type,
so nothing new ships. The output is unchanged.

Refs #160

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@neoromantic
neoromantic merged commit dfa3fbc into main Nov 18, 2026
5 checks passed
@neoromantic
neoromantic deleted the land/179-output-declaration branch November 18, 2026 06:26
ertembiyik added a commit to ertembiyik/telegram-sync-cli that referenced this pull request Nov 18, 2026
main now has neoromantic#179 (neoromantic#188). No conflict.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
ertembiyik added a commit to ertembiyik/telegram-sync-cli that referenced this pull request Nov 18, 2026
main now has neoromantic#179 (neoromantic#188). No conflict.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
ertembiyik added a commit to ertembiyik/telegram-sync-cli that referenced this pull request Nov 18, 2026
main now has neoromantic#179 (neoromantic#188). CHANGELOG: both Changed entries kept.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
ertembiyik added a commit to ertembiyik/telegram-sync-cli that referenced this pull request Nov 18, 2026
main now has neoromantic#179 (neoromantic#188). CHANGELOG: main's Changed section, then this PR's Removed.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
ertembiyik added a commit to ertembiyik/telegram-sync-cli that referenced this pull request Nov 18, 2026
main now has neoromantic#179 (neoromantic#188). No conflict.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
ertembiyik added a commit to ertembiyik/telegram-sync-cli that referenced this pull request Nov 18, 2026
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.

2 participants