Replace storefront naming across source, tests, docs, config, and production scripts. Rename the legacy top-level app directory and Carplace component files, remove duplicate storefront startup scripts, and refresh the lockfile.
Three fixes:
1. React/ReactDOM version mismatch (root cause of 11 test failures):
@testing-library/react (hoisted to root) resolved react-dom@18.3.1 from
root node_modules, but homepage components use React 19. React 19 JSX
elements cannot be rendered by react-dom 18, producing 'Objects are not
valid as a React child' errors.
Fix: added react-dom@^19.2.0 to root package.json, making root-level
react-dom v19.2.7. @testing-library/react now resolves react-dom@19,
matching the homepage's React 19 components.
2. TypeScript target (warning elimination):
Changed homepage tsconfig target from ES2024 to ES2022. The installed
Vite/esbuild version does not recognize ES2024.
3. Pricing currency test (test/configuration mismatch):
The production pricing-config.ts uses currency 'MAD' (Moroccan dirham).
Updated the test expectation from 'USD' to 'MAD' to match.
Validation:
- Focused tests: 6/6 files, 14/14 tests pass
- Full homepage: 16/16 files, 51/51 tests pass
- Full API: 150/150 files, 716/716 tests pass (no regressions)
Root cause: @vitest/coverage-v8@^4.1.0 forced vitest@4.1.9 into
apps/homepage/node_modules, creating two vitest installations (v2 at root,
v4 in homepage). @testing-library/jest-dom's vitest.d.ts augmented the root
vitest v2 module, but homepage tests imported vitest v4 — so the type
augmentation for matchers (toBeDisabled, toHaveAttribute, etc.) never applied.
Fix: downgrade @vitest/coverage-v8 from ^4.1.0 to ^2.1.9 to match vitest 2.x
used by the rest of the monorepo. This unifies vitest at v2.1.9 across all
workspaces, allowing the jest-dom type augmentation to take effect.
Validation:
- npm ls vitest: single v2.1.9 installation (no nested vitest in homepage)
- Homepage type-check (tsc --noEmit): 0 errors (all TS2339 resolved)
- Existing setup.ts and vitest.config.ts were already correctly configured
Root cause: apps/api declared react@18 but @types/react@19, creating a nested
apps/api/node_modules/@types/react@19.2.17 that conflicted with @react-pdf/renderer's
type resolution from root node_modules/@types/react.
Changes:
- Removed react-dom from apps/api dependencies (unused)
- Removed @types/react and @types/react-dom from apps/api devDependencies
- Both API code and @react-pdf/renderer now resolve @types/react from a single
root copy (v19), eliminating the TS2769 contextType incompatibility errors
- Regenerated package-lock.json with deduped dependency tree
Validation:
- npm ls shows single @types/react installation
- No nested @types/react under apps/api/node_modules
- API type-check (tsc --noEmit): 0 errors
- API build: succeeds
- Docker build (Dockerfile.production): all 6 packages build successfully