From c7acdbd3fd0af27c4792cf8112ca0f0ca1a468a8 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 12 Jan 2026 02:16:37 +0000 Subject: [PATCH] fix: restore build:dist and gate in CI --- .github/workflows/ci.yml | 3 +++ CHANGELOG.md | 1 + src/commands/bookmarks.ts | 4 ++-- src/commands/lists.ts | 4 ++-- src/commands/user-tweets.ts | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5aa2d00..ce30715 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,5 +34,8 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile + - name: Build dist + run: pnpm run build:dist + - name: Run tests run: pnpm test diff --git a/CHANGELOG.md b/CHANGELOG.md index 665a9d8..27a4236 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Following/followers pagination now guards repeat cursors and standardizes JSON output (#28) — thanks @malpern. - Lists GraphQL feature flags updated to prevent 400s (#27) — thanks @zheli. - Likes pagination now follows cursors and avoids stalling on duplicate pages (#12) — thanks @titouv. +- `pnpm run build:dist` now succeeds after tightening JSON/pagination option typing in tweet output commands. ### Tests - Following: split following/likes tests + cover cursor handling (#33) — thanks @VACInc. diff --git a/src/commands/bookmarks.ts b/src/commands/bookmarks.ts index 89a8ed3..a4a5fde 100644 --- a/src/commands/bookmarks.ts +++ b/src/commands/bookmarks.ts @@ -40,7 +40,7 @@ export function registerBookmarksCommand(program: Command, ctx: CliContext): voi process.exit(1); } - const usePagination = cmdOpts.all || cmdOpts.cursor; + const usePagination = Boolean(cmdOpts.all || cmdOpts.cursor); if (maxPages !== undefined && !usePagination) { console.error(`${ctx.p('err')}--max-pages requires --all or --cursor.`); process.exit(1); @@ -73,7 +73,7 @@ export function registerBookmarksCommand(program: Command, ctx: CliContext): voi if (result.success && result.tweets) { const emptyMessage = folderId ? 'No bookmarks found in folder.' : 'No bookmarks found.'; - const isJson = cmdOpts.json || cmdOpts.jsonFull; + const isJson = Boolean(cmdOpts.json || cmdOpts.jsonFull); ctx.printTweetsResult(result, { json: isJson, usePagination, emptyMessage }); } else { console.error(`${ctx.p('err')}Failed to fetch bookmarks: ${result.error}`); diff --git a/src/commands/lists.ts b/src/commands/lists.ts index 8aef7d9..e969499 100644 --- a/src/commands/lists.ts +++ b/src/commands/lists.ts @@ -107,7 +107,7 @@ export function registerListsCommand(program: Command, ctx: CliContext): void { process.exit(2); } - const usePagination = cmdOpts.all || cmdOpts.cursor || maxPages !== undefined; + const usePagination = Boolean(cmdOpts.all || cmdOpts.cursor || maxPages !== undefined); if (!usePagination && (!Number.isFinite(count) || count <= 0)) { console.error(`${ctx.p('err')}Invalid --count. Expected a positive integer.`); process.exit(1); @@ -138,7 +138,7 @@ export function registerListsCommand(program: Command, ctx: CliContext): void { : await client.getListTimeline(listId, count, timelineOptions); if (result.success && result.tweets) { - const isJson = cmdOpts.json || cmdOpts.jsonFull; + const isJson = Boolean(cmdOpts.json || cmdOpts.jsonFull); ctx.printTweetsResult(result, { json: isJson, usePagination, diff --git a/src/commands/user-tweets.ts b/src/commands/user-tweets.ts index 52aa6d7..e09a67a 100644 --- a/src/commands/user-tweets.ts +++ b/src/commands/user-tweets.ts @@ -114,7 +114,7 @@ export function registerUserTweetsCommand(program: Command, ctx: CliContext): vo }); if (result.success && result.tweets) { - const isJson = cmdOpts.json || cmdOpts.jsonFull; + const isJson = Boolean(cmdOpts.json || cmdOpts.jsonFull); ctx.printTweetsResult(result, { json: isJson, usePagination: wantsPaginationOutput,