fix: repair cross-package bugs so all tests and tsc pass - #103
Open
stooit wants to merge 1 commit into
Open
Conversation
- api.ts: import useDebounce and re-export as useSearchDebounce (hook was renamed in @e2e/utils; api.ts still referenced the old useThrottle name) - Button: set an aria-label fallback for icon-only buttons and warn in dev when none is supplied, satisfying WCAG 4.1.2 accessible-name test - DataTable: consolidate sort state into a single object updated via the functional setter, so toggling direction reads current (not stale) state - date.ts: use day "numeric" (not 2-digit) so day 1 renders as 1/MM/YYYY and is unambiguous vs a padded month; keep en-AU day-first format - tsconfig: add bun-types to types so bun:test resolves under tsc --noEmit
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 the outstanding
tsc --noEmiterror across the monorepo. Bugs spannedpackages/ui,packages/utils, andapps/web.Before: 5 failing tests + 1 blocking type error.
After:
bun run test→ 13 pass / 0 fail;npx tsc --noEmit→ exit 0.No test files were modified. No dependencies were added.
Fixes
apps/web/src/lib/api.ts@e2e/utils;api.tsstill imported the olduseThrottle. Now importsuseDebounceand re-exports it asuseSearchDebounce(the name the tests expect).packages/ui/src/components/Button/Button.tsxaria-labelfallback and emit a dev warning when none is supplied, satisfying the WCAG 4.1.2 accessible-name test.packages/ui/src/components/DataTable/DataTable.tsxpackages/utils/src/format/date.tsnumericso day 1 renders as1/MM/YYYYand is unambiguous versus a zero-padded month; retainsen-AUday-first format.tsconfig.jsonbun-typestotypessobun:testresolves cleanly undertsc --noEmit(uses the already-installed package; no new dependency).Verification
bun run test— 13 pass, 0 failnpx tsc --noEmit— exit 0Assumptions
@e2e/utilsisuseDebounce, re-exported asuseSearchDebouncefor the app layer, based on what the tests import.bun-typesto tsconfig is in-scope: it was a pre-existing blocker to a cleantsc --noEmitand uses an already-installed package.