refactor: architectural decouple for testability and CI pipeline integration#7
Merged
Conversation
- Add Prettier with .prettierrc config (tabs, single quotes, trailing commas) - Add ESLint with @typescript-eslint for static analysis - Add Husky pre-commit hook with lint-staged - Add format/lint scripts to package.json - Fix lint errors (unused vars, unused imports) - Format entire codebase with Prettier
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR transitions the codebase from a tightly coupled vanilla implementation to a modular, test-driven architecture. By separating core state machines, side effects, and DOM rendering, we have unlocked absolute type safety and established a fail-fast delivery pipeline.
Architectural Changes
main.tsIsolation: Reduced from 80 lines of DOM lookups to a clean 4-line bootstrapper, delegating all responsibility directly to self-initializing components.src/components/timer.tsinto a mathematically puretimer-core.tsmodule with 100% test coverage.computeClockTick), completely independent of browser runtime environments.playBeep) to accept an optional injected context, eliminating Node.js test crashes caused by missing Web Audio APIs.Automated Validation Suite
tsc --noEmit), and production bundle builds on all operations targetingdevandmain.