Skip to content

fix(frontend): 프로덕션 이미지 빌드에서 테스트 타입체크 제외#399

Merged
haksungjang merged 1 commit into
mainfrom
fix/frontend-image-build-tests-tsconfig
Jun 12, 2026
Merged

fix(frontend): 프로덕션 이미지 빌드에서 테스트 타입체크 제외#399
haksungjang merged 1 commit into
mainfrom
fix/frontend-image-build-tests-tsconfig

Conversation

@haksungjang

Copy link
Copy Markdown
Contributor

v0.11.0 trusca-frontend 이미지 빌드 실패 수정.

원인

Dockerfile.prodnpm run build(tsc -b)가 tsconfig.app.jsoninclude: [src, tests] 때문에 테스트까지 타입체크하는데, 검증 캠페인의 카탈로그 정합 테스트(catalogMirrors.test.ts)가 레포 루트 tests/contracts/*.json을 import → Docker 빌드 컨텍스트(apps/frontend)엔 그 파일이 없어 TS2307. 계약 테스트가 v0.10.0 이후에 들어와 이번이 첫 이미지 빌드 노출(리네임과 무관).

수정

  • tsconfig.app.jsonsrc만(테스트 전용 ambient types 제거).
  • 신규 tsconfig.spec.json(src+tests, vitest/jest-dom types) + tsconfig.json references 등재 → CI npm run typecheck(tsc -b)는 기존대로 테스트 포함.
  • build 스크립트 → tsc -b tsconfig.app.json tsconfig.node.json && vite build.

검증

전체 typecheck clean · 앱 전용 tsc(Docker 경로) clean · 계약 vitest 12/12.

후속(머지 후)

v0.11.0 태그를 이 커밋으로 이동 후 release 재실행(태그 직후라 미배포·미당김, compose 기본값 0.11.0 정합 유지).

The v0.11.0 trusca-frontend image build failed: Dockerfile.prod runs
`npm run build` (`tsc -b`), tsconfig.app.json included `tests`, and the
catalog-mirror contract test imports the shared catalog JSON from the REPO
ROOT (../../tests/contracts/), which does not exist inside the image build
context (apps/frontend only) -> TS2307. First image build since the
validation-campaign contract tests landed, so first exposure.

Split the projects: tsconfig.app.json now covers src only (and drops the
test-only ambient types); a new tsconfig.spec.json owns src+tests and is
referenced from tsconfig.json, so CI's `npm run typecheck` (`tsc -b`) still
type-checks tests exactly as before. `npm run build` builds only the
app+node projects, which is all the production bundle needs.

Verified: full typecheck clean, app-only tsc clean (the Docker path),
contract vitest 12/12.
@haksungjang haksungjang merged commit d074830 into main Jun 12, 2026
19 checks passed
@haksungjang haksungjang deleted the fix/frontend-image-build-tests-tsconfig branch June 12, 2026 16:00
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