fix: repair cross-package monorepo bugs (all tests + typecheck pass) - #121
Open
stooit wants to merge 1 commit into
Open
fix: repair cross-package monorepo bugs (all tests + typecheck pass)#121stooit wants to merge 1 commit into
stooit wants to merge 1 commit into
Conversation
- api.ts: import renamed useDebounce (was useThrottle) from @e2e/utils - Button: forward aria-label so icon-only buttons expose an accessible name - date.ts: format en-AU day-first (1/03/2024) via formatToParts - bunfig.toml: preload ui DOM setup so component tests run from repo root - tsconfig.json: add bun-types so bun:test resolves under tsc
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. Baseline was 4 pass / 9 fail with 4 tsc errors; now 13 pass / 0 fail and
tsc --noEmitexits 0.Four cross-package bugs plus two test-environment/config gaps, all fixed with minimal changes. No test files modified, no new dependencies added.
Changes
apps/web/src/lib/api.tsuseThrottlewas renamed touseDebouncein@e2e/utilsbut the old name was still imported/re-exported. Updated import +useDebounce as useSearchDebouncere-export.packages/ui/src/components/Button/Button.tsxaria-labelto the element (with a dev-only warning + generic fallback when omitted oniconOnly), satisfying WCAG 2.2 SC 4.1.2.packages/utils/src/format/date.tsformatDateproduced US-style01/03/2024. Now emits en-AU day-first1/03/2024(unpadded day, zero-padded month, 4-digit year) via formatToParts.bunfig.tomlenvironmentkey, sobun testfrom the repo root had no DOM globals. Replaced withpreloadof the ui package's setup file.tsconfig.json"types": ["bun-types"]sobun:testresolves undertsc --noEmit(bun-types was already a devDependency).Verification
bun test(from repo root): 13 pass / 0 failbunx tsc --noEmit: exit 0, no errorsdate.tsspot-checked across multiple dates to confirm it generalises rather than hardcoding the assertion.Assumptions & notes
sortDiris current across discrete clicks. Left untouched per "fix only what the tests require."aria-labelfallback of "Button" is a WCAG 4.1.2 compliance floor, not a meaningful name (a type-required label was not possible because the tsconfig includes test files, one of which rendersiconOnlywithout a label and cannot be modified). A lint rule at call sites is the recommended stronger follow-up.