fix: repair cross-package bugs so all tests and typecheck pass - #84
Open
stooit wants to merge 1 commit into
Open
fix: repair cross-package bugs so all tests and typecheck pass#84stooit wants to merge 1 commit into
stooit wants to merge 1 commit into
Conversation
- utils: export useSearchDebounce (renamed hook) and reconcile api.ts import - ui: pass aria-label/props through to icon-only Button element - utils: format dates as en-AU D/MM/YYYY using timezone-stable UTC getters - tsconfig: add bun-types so bun:test resolves in test files
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 across the monorepo (
packages/ui,packages/utils,apps/web). Result: 13 pass / 0 fail andtsc --noEmitexits clean.The correct test invocation (per
package.json) is:bun test packages/utils/test packages/ui/test apps/web/test --preload ./packages/ui/test/setup.tsA bare
bun testfails withdocument is not definedbecause it skips the happy-dom preload — a runner-invocation artifact, not a source bug.Bugs fixed
packages/utils/src/index.ts,apps/web/src/lib/api.ts) — tests andapi.tsexpecteduseSearchDebouncefrom@e2e/utils, but it wasn't exported;api.tsalso imported a non-existentuseThrottle(TS2305). Reconciled to the correct hook and export name.packages/ui/src/components/Button/Button.tsx) — icon-only buttons now passaria-label/button props through to the rendered element.packages/utils/src/format/date.ts) — now produces en-AUD/MM/YYYY(no leading zero on the day). Uses UTC getters so output is timezone-stable (a naive local-time fix would break on AU-offset machines even though it passes in UTC CI).bun:testtype resolution (tsconfig.json) — added"types": ["bun-types"]so thebun:testimport in test files type-checks. Config-only; no test files modified.DataTable's stale-closure re-render test was verified to pass without changes under the correct preload command.
Assumptions
package.json(with the happy-dom preload), not a barebun test.useSearchDebounce(what the tests assert);api.tswas the stale consumer.D/MM/YYYY(day-before-month, no leading zero on the day) is the expectedformatDateoutput.Verification
bun test ... --preload ./packages/ui/test/setup.ts→ 13 pass / 0 failbunx tsc --noEmit→ 0 errorsConstraints honoured
No test files modified, no dependencies added. Changes: 5 files, +9/-14.