Skip to content

fix: dep alignment, type fixes, treeshaking, and testing-library types - #938

Merged
jordan-a-young merged 3 commits into
mainfrom
fix/dep-alignment-types-treeshaking
Sep 22, 2026
Merged

jordan-a-young merged 3 commits into
mainfrom
fix/dep-alignment-types-treeshaking

Conversation

@jordan-a-young

Copy link
Copy Markdown
Member

Summary

Comprehensive dependency and type hygiene pass across all packages.

Dependency Changes

peerDependencies alignment:

  • Added missing packages to devDependencies where they were declared as peers but absent from dev (accordion, drawer, controlled-form, feedback)
  • Updated stale peer version ranges (autocomplete @availity/api-axios ^12 → ^13, utils @mui/utils ^6 → ^7)
  • Added peerDependenciesMeta with optional: true for @tanstack/react-query in packages where it's not required at runtime (authorize, autocomplete, controlled-form, page-header)
  • Removed @availity/mui-spaces from page-header peerDependencies — it's a direct runtime dep, not a peer
  • Bumped all @availity/* dep versions to latest patch releases

@availity/element rollup package:

  • Kept @mui/material and @mui/system in dependencies (intentional for now)

Treeshaking

Added sideEffects declarations to packages that were missing them:

  • theme-provider, theme, drawer → sideEffects: false
  • design-tokens → sideEffects: ["./dist/css/**", "./dist/scss/**"] (CSS files are side-effectful)

Type Fixes

DTS build errors (TS2883): Fixed styled() return types leaking MUIStyledCommonProps from MUI's internal @mui/system copy. Applied as typeof X casts in:

  • form-utils/SearchBy.tsx — SearchByContainer as typeof FormGroup
  • form-utils/Select.tsx — SelectDivider as typeof Divider, SelectExpandIcon as typeof ExpandIcon
  • dialog/Dialog.tsx — CloseButtonSlot as typeof CloseButton

Source type errors:

  • spaces/spaces-data.tsx + spaces/DisclaimerModal.tsx — typed avWebQLApi.create()" responses (previously unknown`)
  • file-selector/useFileDelivery.tsx — changed results array from Promise<AxiosResponse>[] to Promise<unknown>[] to match avFilesDeliveryApi return type; removed unused AxiosResponse import

Test type errors:

  • pagination/ResourcePagination.test.tsx — cast avOrganizationsApi to satisfy the Resource type

Testing Library Types (83 errors → 0)

Added testing-library.d.ts at the repo root containing /// <reference types="@testing-library/jest-dom/vitest" /> and registered it via "files": ["testing-library.d.ts"] in tsconfig.base.json.

Root cause: vitest.setup.ts imports @testing-library/jest-dom/vitest at runtime, but individual package tsconfigs only include: ["."] (their own directory), so the setup file's declare module 'vitest' augmentation was never in scope for type checking.

What's left (stories only)

19 type errors remain in .stories.tsx files — all Storybook-only, no shipped code impact. Will be addressed in a follow-up.

- Align peerDependencies across packages (ghost peers, version mismatches,
  optional markers for @tanstack/react-query)
- Add sideEffects declarations for treeshaking (design-tokens, theme,
  theme-provider, drawer)
- Add testing-library.d.ts and tsconfig files entry to fix jest-dom
  Vitest type augmentation in all packages
- Fix TS2883 styled() DTS errors in form-utils, dialog (as typeof cast)
- Fix source type errors: spaces WebQL untyped responses, file-selector
  AxiosResponse mismatch
- Bump @availity/* dep versions to latest patch releases
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Preview deployed!

📖 View Storybook Preview

- authorize: ^6.0.2 → ^6.1.0
- message-core: ^9.3.1 → ^9.3.2 (favorites, form-utils, spaces)
- hooks: ^7.0.1 → ^7.1.0 (spaces)
@jordan-a-young
jordan-a-young merged commit 7f76c5e into main Sep 22, 2026
9 checks passed
github-actions Bot pushed a commit that referenced this pull request Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant