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
12 Commits
Author SHA1 Message Date
Mplan e876dab302 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
2026-06-23 23:04:01 +08:00
Mplan a221f5da7c docs: update .gitignore to include npm config file 2026-06-23 23:03:55 +08:00
Mplan 386884cf1f docs: update installation instructions and version in README 2026-06-23 23:03:12 +08:00
MplanandClaude 301f8f645d chore: bump version to 0.1.4 and clean up cli
Build / bun-build (push) Successful in 36s
- 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>
2026-06-18 01:57:18 +08:00
MplanandClaude 311d059e52 refactor: clean up main entry point
- 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>
2026-06-18 01:57:01 +08:00
MplanandClaude f3b5c631de refactor: use shared helpers in all command handlers
- 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>
2026-06-18 01:56:36 +08:00
MplanandClaude 4fbac6a6e1 refactor: simplify createPR and improve type hierarchy
- 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>
2026-06-18 01:56:13 +08:00
MplanandClaude d4ba4da9d5 refactor: improve menu with shared helpers and error boundaries
- 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>
2026-06-18 01:55:39 +08:00
MplanandClaude 10c7b9a688 feat: add shared diff-source helper (collectDiff)
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>
2026-06-18 01:55:25 +08:00
MplanandClaude 5959d78e6c feat: add shared tty-input module (ask, editLine)
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>
2026-06-18 01:55:04 +08:00
MplanandClaude a1151d7f76 refactor: add shared terminal rendering helpers to terminal.ts
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>
2026-06-18 01:54:37 +08:00
MplanandClaude ff4e18ca8b fix: fix bugs in core modules
- 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>
2026-06-18 01:53:31 +08:00