fix: repair cross-package bugs so all tests and type checks pass#62
Open
stooit wants to merge 1 commit into
Open
fix: repair cross-package bugs so all tests and type checks pass#62stooit wants to merge 1 commit into
stooit wants to merge 1 commit into
Conversation
- api.ts: import the actual useDebounce export (renamed from useThrottle) and re-export it as useSearchDebounce - Button: extend ButtonHTMLAttributes and spread passthrough props so aria-label/disabled/onClick forward to the button; warn on icon-only buttons missing an aria-label (WCAG 4.1.2) - date.ts: use UTC getters with an unpadded day so formatDate is timezone-deterministic and day 1 is not confused with month 1 - tsconfig: register bun-types and include app tests to resolve bun:test
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.
Summary
Fixes all 5 failing tests and all
tsc --noEmiterrors across the monorepo. Bugs spanned three packages plus the root TS config.Verified green:
bun test … --preload ./packages/ui/test/setup.ts→ 13 pass / 0 failnpx tsc --noEmit→ 0 errorsRoot causes & fixes
Renamed hook still imported by old name —
apps/web/src/lib/api.tsimporteduseThrottlefrom@e2e/utils, but the package exportsuseDebounce. Switched the import and theuseSearchDebouncere-export to the real name.Missing accessibility attribute —
packages/ui/src/components/Buttondroppedaria-label.Propsnow extendsReact.ButtonHTMLAttributes<HTMLButtonElement>and the component spreads passthrough props onto the<button>, soaria-label,disabled,onClick, etc. all forward. Added aconsole.warnfor icon-only buttons rendered without anaria-label(WCAG 4.1.2).Wrong date format —
formatDateinpackages/utils/src/format/date.tszero-padded the day (01/03/2024). Reimplemented with UTC getters and an unpadded day so1 March 2024→1/03/2024, and the result is timezone-deterministic (avoids host-TZ flakiness on theZ-timestamped fixtures).bun:testunresolved by tsc — roottsconfig.jsondid not register the already-installedbun-types. Added"types": ["bun-types"]and includedapps/*/test/**/*so app tests are in scope.Constraints honoured
bun-typeswas already a devDependency).Assumptions
console.warnrather than omitted — this satisfies the test contract while surfacing the accessibility issue.Z) timestamps, sogetUTC*getters were chosen for deterministic output regardless of the CI host timezone.🤖 Generated with QuantCode Agent