fix: repair cross-package bugs so tests and typecheck pass - #160
Open
stooit wants to merge 1 commit into
Open
Conversation
- bunfig.toml: preload happy-dom setup so DOM globals exist for root `bun test` (the prior `environment = "happy-dom"` key is a no-op in bun) - apps/web api.ts: import/re-export renamed hook useDebounce (was useThrottle) - Button: forward aria-label and provide accessible name for icon-only buttons with a dev warning when unlabelled [WCAG 2.2 SC 4.1.2] - DataTable: collapse sort key/dir into one state object to fix stale-closure bug on second-click descending sort - date.ts: de-pad the day part so en-AU output is day-first single-digit - tsconfig.json: add explicit "types": ["bun-types"] for bun:test resolution No test files, package.json, or lockfile modified; no dependencies added.
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 eliminates all type errors in the monorepo. The acceptance gate
bun test && npx tsc --noEmitnow passes: 13 pass / 0 fail, tsc exit 0 (baseline was 4 pass / 9 fail, 5 TS errors).Bugs spanned all three packages (
packages/ui,packages/utils,apps/web) plus root test config.Fixes
bunfig.tomlenvironment = "happy-dom"is a no-op in bun, so DOM globals were absent when runningbun testfrom the repo root →ReferenceError: document is not definedin all UI tests.apps/web/src/lib/api.tsuseThrottlefrom@e2e/utils, but the hook was renamed touseDebounce(TS2305).packages/ui/.../Button.tsxaria-label-derived name is present.aria-label; provide a fallback accessible name for icon-only buttons with a dev warning when unlabelled [WCAG 2.2 SC 4.1.2].packages/ui/.../DataTable.tsxsortKey/sortDirstate meant second-click descending sort read a stale value.packages/utils/.../date.tsIntlwidens a numeric day to01, soformatDate(1 Mar 2024)returned01/03/2024; test expects day-first single-digit1/03/2024.formatToParts.tsconfig.jsonbun:testunresolved (TS2307) —bun-typeslives outsidenode_modules/@types/so it isn't auto-included."types": ["bun-types"]with an explanatory comment.Assumptions & notes
package.json, or lockfile were modified; no dependencies added — per task constraints (verified viagit diff --name-only).tsconfig.json"types"array disables auto-inclusion of other@types/*packages.@types/reactstill resolves via module imports and typecheck is clean; a comment was added so future@types/*additions aren't silently ignored.Props/API change), makes the new-column path atomic, and produces identical output for all tested sequences. Reviewed as justified and low-risk.console.warnseen during the test run is expected — a test exercises the unlabelled icon-only Button path.Verification
bun test→ 13 pass, 0 failnpx tsc --noEmit→ exit 0Out of scope (pre-existing, flagged for follow-up)
DataTablesortable<th>is mouse-only (no keyboard handler) — pre-existing WCAG 2.2 SC 2.1.1 gap.formatDate(4-digit year) vsformatDateTime(dateStyle: "short", 2-digit year) inconsistency — pre-existing.