Skip to content

chore: review module dependencies warns#3194

Merged
ommeirelles merged 8 commits intocanary-v2from
chore/SFS-3035
Feb 3, 2026
Merged

chore: review module dependencies warns#3194
ommeirelles merged 8 commits intocanary-v2from
chore/SFS-3035

Conversation

@ommeirelles
Copy link
Copy Markdown
Contributor

@ommeirelles ommeirelles commented Feb 2, 2026

Updated dependencies:

  • "@testing-library/jest-dom"

  • "@lhci/cli": "^0.15.1",

  • "@graphql-codegen/cli": 6.1.1 - Updated to V6 as it was triggering warns in respect to their dependencies

  • [REMOVED] @types/cypress - Its not necessary on our current version of cypress anymore

  • [REMOVED] "@storybook/addon-interactions": "^8.6.14" - Is part of core storybook package now

  • [REMOVED] "@storybook/test": "^8.6.14" - Is part of core storybook package now

  • Removed unnecessary storybook addons that is part of storybook@9.

  • Migrate packages tests that used jest to vitest, Removed vite configurations and created vitest.

  • Updated pnpm to latest version stable.

[NOW]

image

[BEFORE]

image
  • Deps unable to fix:

domexception@1.0.1, glob@7.2.3, inflight@1.0.6, node-domexception@1.0.0, rimraf@2.7.1, rimraf@3.0.2, tar@6.2.1

Summary by CodeRabbit

  • Tests
    • Migrated component and SDK test suites from Jest to Vitest, added Vitest configs and centralized setup, and updated tests to use Vitest APIs and matchers.
  • Chores
    • Upgraded Storybook to 10.2.3 and simplified addons.
    • Updated development dependencies and package manager entries across packages.

@ommeirelles ommeirelles requested a review from a team as a code owner February 2, 2026 13:44
@ommeirelles ommeirelles requested review from hellofanny and lariciamota and removed request for a team February 2, 2026 13:44
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 2, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (4)
  • .github/workflows/ci.yml is excluded by none and included by none
  • .github/workflows/release-dev.yml is excluded by none and included by none
  • .github/workflows/release.yml is excluded by none and included by none
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

Walkthrough

This pull request migrates testing from Jest to Vitest across the components and sdk packages, adds Vitest configs and setup files, removes per-package Jest configs and setup, updates TypeScript test types, upgrades Storybook to v10 (removing an addon), and bumps core dev tooling and packageManager.

Changes

Cohort / File(s) Summary
Components — test infra
packages/components/jest.config.js, packages/components/jest.setup.ts, packages/components/package.json
Removed local Jest config and Jest setup imports; changed test script to vitest run; removed Jest devDeps and added vitest, vitest-axe; bumped @testing-library/jest-dom.
Components — Vitest config & setup
packages/components/vitest.config.mts, packages/components/vitest.setup.ts, packages/components/tsconfig.json
Added Vitest config and setup file; switched tsconfig test types from jest-globals to @testing-library/jest-dom/vitest.
Components — tests & minor code
packages/components/test/molecules/..., packages/components/src/molecules/Toast/Toast.tsx
Migrated tests to Vitest (vi, cleanup, axe usage adjustments, renderResult usage); changed Toast timeoutRef type from NodeJS.Timeout to number.
SDK — test infra
packages/sdk/jest.config.js, packages/sdk/package.json, packages/sdk/vitest.config.mts, packages/sdk/test/setup.ts
Removed Jest config and setup; switched test script to Vitest; added Vitest, jsdom, and ts/react typings; new Vitest config; removed fake-indexeddb assignment from setup.
SDK — tests
packages/sdk/test/**/*.test.*
Replaced Jest globals with Vitest equivalents across many test files (jest.fnvi.fn, jest.spyOnvi.spyOn, restoreAllMocks→vi.restoreAllMocks`, added vitest imports).
Storybook
packages/storybook/.storybook/main.ts, packages/storybook/package.json
Upgraded Storybook to v10, switched to ESM resolution with import.meta.resolve, removed @storybook/addon-interactions and @storybook/test from addons/devDeps.
Core package
packages/core/package.json
Bumped packageManager to pnpm@10.28.0, upgraded @lhci/cli, removed @types/cypress devDependency.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • hellofanny
  • lemagnetic
  • lariciamota

Poem

🧪 From Jest to Vitest we flew,
Tests reborn in a lighter hue,
Storybook stepped up to ten,
Types and setups cleaned again,
CI hums—let green checks ensue! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'chore: review module dependencies warns' is vague and unclear—it does not accurately describe the main changes (Jest-to-Vitest migration, dependency updates, and deprecation resolution). Use a clearer title like 'chore: migrate tests from Jest to Vitest and resolve dependency warnings' to accurately reflect the primary changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/SFS-3035

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented Feb 2, 2026

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Fix all issues with AI agents
In `@packages/components/src/molecules/Dropdown/index.ts`:
- Around line 12-31: The pull makes all Dropdown exports lazy which breaks
consumers that render Dropdown without a Suspense boundary (e.g.,
MyAccountOrderActions); restore a synchronous default export for Dropdown and
the other components (DropdownButton, DropdownMenu, DropdownItem) and add
explicit lazy variants (e.g., DropdownLazy, DropdownButtonLazy,
DropdownMenuLazy, DropdownItemLazy) that use lazy(...) so downstream code that
doesn’t use Suspense keeps working while consumers that want code-splitting can
opt into the *_Lazy exports; update the exports in this module accordingly and
keep existing import paths/names for synchronous usage.

In `@packages/components/test/molecules/Card/Card.test.tsx`:
- Line 12: mockIconAction is declared once at describe scope and not reset
between tests, causing state leakage; fix by either moving its creation into a
beforeEach (e.g., set mockIconAction = vi.fn() inside beforeEach) or calling
mockIconAction.mockReset()/mockClear() in beforeEach (or use vi.clearAllMocks())
so each test gets a fresh mock; update tests that reference mockIconAction
accordingly (e.g., the "executes the icon action" and accessibility tests) to
rely on the reset mock.

In `@packages/components/test/molecules/CheckboxField/CheckboxField.test.tsx`:
- Around line 73-74: The TypeScript suppression hides that the matcher typing
for toHaveNoViolations (used with axe in CheckboxField.test.tsx) is missing from
vitest-axe; fix by either upgrading vitest-axe to a version that ships proper
type definitions or add a small declaration-merge file (e.g., a global .d.ts in
your test types) that augments Vitest's expect/Assertion interface with the
toHaveNoViolations matcher signature; then remove the // `@ts-expect-error` and
run typechecks to ensure axe(container) and expect(...).toHaveNoViolations()
compile cleanly.

In `@packages/core/package.json`:
- Line 93: Root package.json is missing the `@lhci/cli` devDependency which causes
the dependency checker in packages/cli/src/utils/generate.ts to warn; add
"@lhci/cli": "^0.15.1" to the root devDependencies block in package.json to
match the version used in core, then run install to update the lockfile so the
checker no longer emits warnings.

In `@packages/sdk/test/store/optimistic.test.ts`:
- Around line 10-13: The test's mocked validator onValidate is leaving its
parameter x implicitly any; update the mock so the validator is explicitly typed
for numbers (e.g., annotate the mock or the variable as (x: number) =>
Promise<number | null>) so it matches the expected signature used by getStore(0,
onValidate) and satisfies strict typing.
🧹 Nitpick comments (6)
packages/sdk/test/search/usePagination.test.tsx (2)

8-28: Consider removing unnecessary async keywords.

Both test functions are marked async but contain no await statements. This is harmless but adds noise.

♻️ Optional cleanup
-test('usePagination: paginates forwards', async () => {
+test('usePagination: paginates forwards', () => {
-test('usePagination: paginates backwards', async () => {
+test('usePagination: paginates backwards', () => {

Also applies to: 30-54


11-11: TypeScript safety: PropsWithChildren<any> could be tightened.

Using any weakens type checking. Since wrapper only needs children, consider using unknown or an empty object type.

♻️ Stricter typing
-    wrapper: ({ children }: PropsWithChildren<any>) => (
+    wrapper: ({ children }: PropsWithChildren<unknown>) => (

Also applies to: 36-36

packages/components/src/molecules/Breadcrumb/BreadcrumbBase.tsx (1)

141-163: Add Suspense fallback for lazy-loaded Dropdown.
Lazy components without a fallback can cause layout shift. Provide a lightweight placeholder to maintain layout stability while code chunks load.

♻️ Suggested fallback
-        {collapseBreadcrumb && (
-          <Suspense>
+        {collapseBreadcrumb && (
+          <Suspense
+            fallback={
+              <span
+                aria-hidden="true"
+                data-fs-breadcrumb-dropdown-fallback
+              />
+            }
+          >
packages/components/vitest.setup.ts (1)

1-6: Redundant axe matcher extension.

Lines 2-3 manually extend expect with vitest-axe/matchers, but line 6 imports vitest-axe/extend-expect which does the same thing. Pick one approach.

♻️ Simplified setup using side-effect imports only
-import { expect } from 'vitest'
-import * as matchers from 'vitest-axe/matchers'
-expect.extend(matchers)
-
 import '@testing-library/jest-dom/vitest'
 import 'vitest-axe/extend-expect'
packages/components/test/molecules/Card/Card.test.tsx (1)

52-53: Type suppression for vitest-axe noted.

The @ts-expect-error indicates a type mismatch between vitest-axe and the extended matchers. This is a known issue with early versions of vitest-axe. Consider tracking this as tech debt to remove once types are fixed upstream or by adding proper type augmentation in your setup file.

packages/components/package.json (1)

41-51: @testing-library/jest-dom and @vitejs/plugin-react can remain as hardcoded versions; vitest-axe warrants a quick accessibility verification.

These packages are only used in packages/components, so adding them to the pnpm catalog isn't necessary for monorepo consistency. However, verify that vitest-axe@^0.1.0 meets your accessibility testing requirements—it's a pre-1.0 release and may lack stability or features you need.

Comment thread packages/components/src/molecules/Dropdown/index.ts Outdated
Comment thread packages/components/test/molecules/Card/Card.test.tsx
Comment thread packages/sdk/test/store/optimistic.test.ts
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@packages/core/package.json`:
- Line 93: Upgrade to `@lhci/cli`@0.15.1 changed Lighthouse behavior causing
assertion failures; run the Lighthouse CI pipeline against your target pages and
update the thresholds in lighthouserc.js accordingly—specifically adjust
categories.best-practices.minScore and any resource-summary threshold entries to
match the new Lighthouse 12.6.1 outputs, re-run until the assertions pass, and
commit the new baseline values.

Comment thread packages/core/package.json
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@packages/storybook/.storybook/main.ts`:
- Around line 3-14: The getAbsolutePath function uses path.join(join(value,
'package.json')) which produces Windows backslashes and breaks
import.meta.resolve; replace join(value, 'package.json') with a POSIX-safe
template string like `${value}/package.json` inside import.meta.resolve in the
getAbsolutePath function so the ESM specifier remains forward-slash-separated on
all platforms and ensure the surrounding parentheses are balanced around
import.meta.resolve and fileURLToPath.

Comment thread packages/storybook/.storybook/main.ts Outdated
Copy link
Copy Markdown
Contributor

@lemagnetic lemagnetic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ommeirelles ommeirelles merged commit ea7dd01 into canary-v2 Feb 3, 2026
4 of 5 checks passed
@ommeirelles ommeirelles deleted the chore/SFS-3035 branch February 3, 2026 13:49
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.

2 participants