fix: resolve cross-package test failures and type errors - #98
Open
stooit wants to merge 1 commit into
Open
Conversation
- api.ts: import current useDebounce export (was stale useThrottle name) - Button: add aria-label for icon-only buttons (WCAG 4.1.2) - DataTable: fix stale closure in controlled re-render - date.ts: en-AU day-first formatting via formatToParts (1/03/2024, keeps 4-digit year) - tsconfig: add bun-types to types array
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 and type errors across the monorepo.
bun run test→ 13 pass / 0 fail;bunx tsc --noEmit→ clean. No test files modified; no dependencies added.Root causes & fixes
apps/web/src/lib/api.ts— the hook was renamed inpackages/utils(useThrottle→useDebounce), but the consumer still imported the old name. Updated the import to the currentuseDebounceexport.packages/ui/.../Button/Button.tsx— icon-only buttons lacked an accessible name. Added thearia-labelrequired for WCAG 4.1.2.packages/ui/.../DataTable/DataTable.tsx— fixed a stale-closure bug surfaced by the controlled re-render test.packages/utils/src/format/date.ts— date formatting produced US month-first / 2-digit-year output. Now usesen-AUviaIntl.DateTimeFormat.formatToPartsto emit day-first1/03/2024(unpadded day, zero-padded month, 4-digit year). en-AU ICU widens a numeric day to 2-digit when paired with a 2-digit month, soformatToPartskeeps the day unpadded as the test requires.tsconfig.json— addedbun-typesto thetypesarray (Bun globals; does not loosen strictness).Verification
bun run test: 13 passing across 5 filesbunx tsc --noEmit: exit 0Notes / assumptions
useThrottle→useDebouncerename inpackages/utilswas treated as intentional; the stale consumer was reconciled rather than reverting the rename.