proposal-system/web/vitest.config.ts
Adam Moussa e6e2c60c2f
feat(web): scaffold domain module layer (proposals, lineItems, customers, pricingLibrary, admin, sites)
Additive-only: pages still use lib/api/* and constants/queryKeys.ts until
the page-migration agents run. Each domain ships api.ts (HTTP moved from
lib/api), types.ts (contract re-exports + view types), schemas.ts (contract
schema re-exports + form schemas with toRequest mappers), and use-cases.ts
(TanStack Query v5 hooks + hierarchical query keys, mirroring current page
invalidations and toast-on-error behavior).

Adds an explicit vite/vitest alias for the
@proposal-system/api-contracts/schemas subpath (package has no exports map)
plus a schema/mapper smoke test suite.
2026-07-13 17:58:19 -04:00

31 lines
1.1 KiB
TypeScript

import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
// @proposal-system/api-contracts has no `exports` map (main points at
// src/index.ts), so the /schemas subpath entrypoint needs an explicit
// alias for vitest's resolver (mirrors the tsconfig `paths` mapping).
'@proposal-system/api-contracts/schemas': fileURLToPath(
new URL('../shared/api-contracts/src/schemas.ts', import.meta.url)
),
},
},
test: {
environment: 'jsdom',
globals: true,
setupFiles: ['./src/test/setup.ts'],
include: ['src/**/*.test.{ts,tsx}'],
server: {
deps: {
// MUI v9's ESM build (Transition.mjs) does a directory import of
// react-transition-group/TransitionGroupContext, which Node's native
// ESM loader can't resolve. Inline these so Vite resolves them.
inline: [/@mui\/material/, 'react-transition-group'],
},
},
},
});