fix: repair cross-package bugs and test DOM/type configuration#75
Open
stooit wants to merge 1 commit into
Open
fix: repair cross-package bugs and test DOM/type configuration#75stooit wants to merge 1 commit into
stooit wants to merge 1 commit into
Conversation
- api.ts: import useDebounce (renamed from useThrottle) and re-export as useSearchDebounce - Button: set aria-label for icon-only buttons for accessible name - DataTable: use functional state updater to fix stale-closure sort direction - date.ts: use en-AU dateStyle:'short' so day/month order follows locale - bunfig.toml (root): register happy-dom + setup preload so component tests get a DOM at root-level runs - tsconfig.json: add bun-types so 'bun:test' resolves
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 in the monorepo.
bun test && bunx tsc --noEmitnow passes cleanly from the repo root (13 pass, 0 fail; tsc exit 0).Bug fixes (source root-causes)
apps/web/src/lib/api.tsimporteduseThrottle, but the hook inpackages/utilswas renamed touseDebounce. Updated the import and re-exported it asuseSearchDebounce(the name the test expects).Buttonnow sets anaria-labelso it has an accessible name.packages/utils/src/format/date.tsused a locale/format that swapped day and month. Now uses a locale-correctdateStyle: 'short'so day 1 is not confused with month 1.Test/type infrastructure
bunfig.toml— added the happy-dom setup preload so React component tests get a DOM whenbun testruns from the repo root (previously only wired intopackages/ui/bunfig.toml, which is not read at root level →document is not defined).tsconfig.json— addedbun-typessobun:testimports resolve undertsc --noEmit.Verification
bun test→ 13 pass / 0 failbunx tsc --noEmit→ exit 0Notes / assumptions