Skip to content

refactor(vimsplain): mode-based handlers and testing architecture#17

Merged
oller merged 9 commits intomainfrom
feat/vimsplain-refactor-mode-handlers
Mar 22, 2026
Merged

refactor(vimsplain): mode-based handlers and testing architecture#17
oller merged 9 commits intomainfrom
feat/vimsplain-refactor-mode-handlers

Conversation

@oller
Copy link
Copy Markdown
Owner

@oller oller commented Mar 21, 2026

Summary

  • Property-Based Testing: Added fast-check to fuzz the parser with millions of synthetic command combinations to catch edge cases before refactoring.
  • Integration Testing: Added tests that run commands against an actual headless CodeMirror instance (via @replit/codemirror-vim) to verify vimsplain's explanations perfectly map to the state changes in CodeMirror.
  • Architecture Refactoring: The core parser was completely refactored from a monolithic while loop into a Mode-based Handler architecture, significantly simplifying vimsplain.ts.
  • Mode Handlers: Logic extracted to src/handlers/normal.ts, insert.ts, visual.ts, command.ts, and search.ts.

Test Plan

  • All 331 tests run completely green
  • Test coverage for the vimsplain package is at 97.68% overall
  • Linting and typechecks succeed

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 21, 2026

Deploy Preview for vim-gym ready!

Name Link
🔨 Latest commit 14f54cb
🔍 Latest deploy log https://app.netlify.com/projects/vim-gym/deploys/69bff3eb98dbbe0008576543
😎 Deploy Preview https://deploy-preview-17--vim-gym.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 66
Accessibility: 97
Best Practices: 92
SEO: 91
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 21, 2026

🦋 Changeset detected

Latest commit: 14f54cb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
vimsplain Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@oller oller merged commit ae7e73d into main Mar 22, 2026
5 checks passed
@github-actions github-actions bot mentioned this pull request Mar 22, 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.

1 participant