diff --git a/apps/frontend/package.json b/apps/frontend/package.json index ae5f90e7..080f0624 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -7,7 +7,7 @@ "type": "module", "scripts": { "dev": "vite", - "build": "tsc -b && vite build", + "build": "tsc -b tsconfig.app.json tsconfig.node.json && vite build", "preview": "vite preview", "lint": "eslint .", "typecheck": "tsc -b --noEmit", diff --git a/apps/frontend/tsconfig.app.json b/apps/frontend/tsconfig.app.json index 45567d14..7a1854d3 100644 --- a/apps/frontend/tsconfig.app.json +++ b/apps/frontend/tsconfig.app.json @@ -23,7 +23,7 @@ "paths": { "@/*": ["./src/*"] }, - "types": ["vite/client", "vitest/globals", "@testing-library/jest-dom"] + "types": ["vite/client"] }, - "include": ["src", "tests"] + "include": ["src"] } diff --git a/apps/frontend/tsconfig.json b/apps/frontend/tsconfig.json index 1ffef600..32fef050 100644 --- a/apps/frontend/tsconfig.json +++ b/apps/frontend/tsconfig.json @@ -2,6 +2,7 @@ "files": [], "references": [ { "path": "./tsconfig.app.json" }, - { "path": "./tsconfig.node.json" } + { "path": "./tsconfig.node.json" }, + { "path": "./tsconfig.spec.json" } ] } diff --git a/apps/frontend/tsconfig.spec.json b/apps/frontend/tsconfig.spec.json new file mode 100644 index 00000000..418d3582 --- /dev/null +++ b/apps/frontend/tsconfig.spec.json @@ -0,0 +1,36 @@ +{ + // Test-only TypeScript project. Split out of tsconfig.app.json so the + // PRODUCTION image build (`npm run build` -> `tsc -b tsconfig.app.json ...`) + // never type-checks tests: the contract tests import shared catalogs from + // the REPO ROOT (e.g. ../../tests/contracts/*.json), which does not exist + // inside the Docker build context (apps/frontend only) and broke the + // v0.11.0 trusca-frontend image build. CI's `npm run typecheck` + // (`tsc -b --noEmit`) still builds every referenced project, tests included. + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.spec.tsbuildinfo", + "target": "ES2022", + "useDefineForClassFields": true, + "lib": ["ES2022", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "react-jsx", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true, + "baseUrl": ".", + "paths": { + "@/*": ["./src/*"] + }, + "types": ["vite/client", "vitest/globals", "@testing-library/jest-dom"] + }, + "include": ["src", "tests"] +}