fix: repair cross-package bugs so all tests and typecheck pass#68
Open
stooit wants to merge 1 commit into
Open
fix: repair cross-package bugs so all tests and typecheck pass#68stooit wants to merge 1 commit into
stooit wants to merge 1 commit into
Conversation
- utils: alias useDebounce as useSearchDebounce; reconcile stale useThrottle import in apps/web/src/lib/api.ts - ui/Button: pass aria-label through to icon-only buttons with a sensible fallback - ui/DataTable: use functional state updater to fix stale-closure sort toggle - utils/date: use en-AU dateStyle:short so day is day-first without leading zero - tsconfig: reference already-installed bun-types to resolve bun:test type errors
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 failing tests (13/13 pass) and eliminates all
tsc --noEmittype errors across the monorepo. Four cross-package bugs, all fixed at the root cause. No test files modified, no new dependencies added.Bugs fixed
useThrottlewas renamed touseDebounce, butapps/web/src/lib/api.tsstill imported the old name and tests expecteduseSearchDebounce.packages/utils/src/index.tsnow re-exportsuseDebounce as useSearchDebounce, andapi.tsimports a name that exists.aria-labelwas not passed through to icon-only buttons. It now reaches the rendered element, with a sensible fallback for icon-only buttons per the test.formatDateproduced a leading-zero, wrong-order date. Now uses a day-first (en-AU) short format so e.g. 1 March 2024 renders as1/03/2024.Supporting change
tsconfig.jsonreferences the already-installedbun-typesto resolve thebun:testtype-declaration errors. No dependency added.Verification
bun test packages/utils/test packages/ui/test apps/web/test --preload ./packages/ui/test/setup.ts→ 13 pass, 0 failnpx tsc --noEmit→ 0 errorsAssumptions
useSearchDebouncewas chosen as the canonical public name because the tests require it;useDebounceremains the underlying implementation with the alias re-exported.aria-label, a fallback label is applied so the attribute is always present (matching the test's non-null assertion).