chore: release v0.1.4 with npm packaging and shared helpers #7

Merged
Mplan merged 12 commits from v0.1.4 into main 2026-06-23 23:11:59 +08:00
Owner
No description provided.
Mplan added 12 commits 2026-06-23 23:06:13 +08:00
- tty: fix isStdoutTTY to use fstat first, fall back to TERM heuristic
- git: fix commit regex to handle root-commit output format
- git: fix parseNameStatus to handle edge cases (empty lines, missing tabs)
- ai: fix readStream to cancel reader instead of releaseLock
- cli: remove dead code resolveFlagName function
- clipboard: fix inconsistent indentation

Co-Authored-By: Claude <noreply@anthropic.com>
Add hideCursor, showCursor, clearLine, moveUp, clearScreen,
visibleLength, padRight as centralized exports to eliminate
duplication across menu.ts, config.ts, and index.ts.

Also cache isColorEnabled result to avoid repeated env checks.

Co-Authored-By: Claude <noreply@anthropic.com>
Extract duplicated ask() from commit.ts and pr.ts, and extract
the 100+ line inline raw-mode editor editMessage() from commit.ts
into a reusable editLine() with proper escape sequence buffering.

Co-Authored-By: Claude <noreply@anthropic.com>
Unify duplicated diff-collection logic from explain.ts, review.ts,
suggest.ts into a single collectDiff() that handles staged, unstaged,
and piped stdin sources, interactive file selection, diff truncation,
and project context collection.

Co-Authored-By: Claude <noreply@anthropic.com>
- Use shared terminal helpers (hideCursor, showCursor, clearLine,
  moveUp, visibleLength, padRight) from terminal.ts
- Fix normalizeKey to properly buffer SS3 escape sequences (\x1bO)
- Add try/catch+cleanup error boundaries in selectOne and selectMany
  to prevent terminal state leaks (raw mode, hidden cursor) on errors

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace 3 nearly-identical createPR branches (70+ lines each)
  with a single function using PLATFORM_CLI lookup table
- Add BaseContext interface and have PRContext/ProjectContext
  extend it to eliminate field duplication

Co-Authored-By: Claude <noreply@anthropic.com>
- commit.ts, pr.ts: use ask() and editLine() from tty-input module
- config.ts: use shared terminal helpers and escape buffering
- explain.ts, review.ts, suggest.ts: use collectDiff() from
  diff-source module, eliminating ~400 lines of duplicated logic

Co-Authored-By: Claude <noreply@anthropic.com>
- Use shared terminal helpers (hideCursor, showCursor, clearLine,
  clearScreen, visibleLength, padRight) from terminal.ts
- Simplify allCommandDefs dedup with new Set()
- Centralize terminal state restore into exitMenu() closure + finally

Co-Authored-By: Claude <noreply@anthropic.com>
chore: bump version to 0.1.4 and clean up cli
Build / bun-build (push) Successful in 36s
301f8f645d
- Set VERSION = '0.1.4' in brand.ts as single source of truth
- Import VERSION in cli.ts for --version output
- Remove dead code resolveFlagName from cli.ts
- Remove hardcoded version comment from index.ts

Co-Authored-By: Claude <noreply@anthropic.com>
chore: update package.json with scoped name and additional metadata
Build / bun-build (push) Failing after 1m0s
Build / bun-build (pull_request) Failing after 54s
e876dab302
Mplan merged commit 79ac4715e6 into main 2026-06-23 23:11:59 +08:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mplan/gai#7