Skip to content

feat: remove zod, centralize config I/O, add self-update#1

Merged
ryanlee666 merged 1 commit intomainfrom
feat/auto-update
Mar 26, 2026
Merged

feat: remove zod, centralize config I/O, add self-update#1
ryanlee666 merged 1 commit intomainfrom
feat/auto-update

Conversation

@ryanlee666
Copy link
Copy Markdown
Collaborator

Summary

  • Remove zod: replaced with 20-line manual validation, npm bundle 417KB → 310KB (-26%)
  • Centralize config I/O: readConfigFile / writeConfigFile in loader.ts, eliminates yaml parse+stringify duplication across 5 files
  • Self-update mechanism: minimax update [stable|latest|VERSION] — fetches GitHub release manifest, verifies SHA256, atomically replaces current binary
  • Background update check: fire-and-forget on startup, 24h throttle, prints hint to stderr after command completes (respects --quiet)
  • Rewrite install.sh: SHA256 verification, Rosetta2 detection, musl detection, curl/wget fallback, channel parameter, defaults to ~/.local/bin
  • Fix build.ts: proper bun musl targets (not copies), Windows target restored, generates dist/manifest.json with per-platform SHA256
  • CI: release.yml now runs test job first; release job uploads manifest.json alongside binaries

Test plan

  • bun run typecheck passes
  • bun test (62 tests) passes
  • minimax update --dry-run prints correct target without modifying binary
  • install.sh stable downloads, verifies, and installs correctly
  • New version tag triggers CI: test → build → release with manifest.json attached

🤖 Generated with Claude Code

…date

- Remove zod dependency (-200KB bundle); replace with 20-line manual validation
- Centralize config read/write into readConfigFile/writeConfigFile, eliminating
  yaml parse/stringify duplication across 5 files
- Add src/update/checker.ts: background update check, 24h throttle, fire-and-forget
- Add src/update/self-update.ts: SHA256-verified atomic binary replacement
- Add `minimax update [stable|latest|VERSION]` command
- Startup update notification (prints to stderr after command, respects --quiet)
- Rewrite install.sh: SHA256 verification, Rosetta2 detection, musl detection,
  curl/wget fallback, channel param, defaults to ~/.local/bin (no sudo)
- build.ts: proper bun musl targets, Windows target, generates manifest.json with
  per-platform SHA256 checksums
- release.yml: test job gates release job; uploads manifest.json alongside binaries

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ryanlee666 ryanlee666 merged commit a303ca1 into main Mar 26, 2026
2 checks passed
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