fix: repair cross-package bugs and test config in monorepo#57
Open
stooit wants to merge 1 commit into
Open
Conversation
- api.ts: import useDebounce (hook was renamed from useThrottle) - Button: forward aria-label for accessible name on icon-only buttons - DataTable: use functional setState to fix stale-closure sort toggle - date.ts: use dateStyle:'short' so en-AU yields day-first ordering - bunfig.toml: preload happy-dom GlobalRegistrator so DOM globals exist - 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 across the bun-workspaces monorepo.
bun testis now 13 pass / 0 fail andnpx tsc --noEmitexits 0. Changes are minimal and targeted; no test files were modified and no dependencies were added.Bugs fixed
apps/web/src/lib/api.ts— imported a renamed hook under its old name.useThrottle→useDebounce(onlyuseDebounceis exported from@e2e/utils). (fixes TS2305)packages/ui/.../Button/Button.tsx— icon-only button had no accessible name. Forwardsaria-labelto the<button>, satisfyinggetByRole('button', { name: ... }). (WCAG 4.1.2 Name, Role, Value)packages/ui/.../DataTable/DataTable.tsx— stale-closure bug:handleSortreadsortDirfrom the captured closure, so re-clicking a column toggled against a stale value. Switched to the functional updatersetSortDir(prev => ...).packages/utils/src/format/date.ts— explicit numeric field options forcedM/D/Yordering regardless of locale. Switched to{ dateStyle: 'short' }soen-AUcorrectly produces day-first ordering.Test/build config (config-only, no test files touched)
bunfig.toml(root) — addedpreload = ["./packages/ui/test/setup.ts"]so the happy-domGlobalRegistratorregisters DOM globals whenbun testruns from the repo root. FixesReferenceError: document is not defined.tsconfig.json— added"types": ["bun-types"]sobun:testimports resolve undertsc. (fixes TS2307)Verification
bun test→ 13 pass, 0 failnpx tsc --noEmit→ exit 0Assumptions
useDebounce(the only export from@e2e/utils); the olduseThrottleimport was the bug.dateStyle: 'short'is the intended formatting approach foren-AUday-first output.