.jsonc: 주석을 허용하는 JSON 확장 형식
- tasks: 각 태스크의 의존 관계 명시
ready.dependesOn:^ready: 의존하는 ready 먼저 수행ready.inputs:TURBO_DEFAULT,!**/*.md,!**/*.test.*: turbo의 기본 설정(git diff)은 모두 변경 사항으로 감지 but md 확장자, 테스트 코드는 감지 X- turbo repo는 이를 해시값으로 비교해 캐시를 활용할지 구분한다.
ready.outputs:dist/**,build/**: 캐싱할 빌드 결과물- 빌드 결과물은 .turbo에 저장한다.
build.dependsOn:ready,^build: ready 수행 > 의존하는 build 먼저 수행dev.cache:false,dev.persistant:true: 개발 서버는 캐싱할 것이 없음
- boundaries: 패키지 경계 규칙
-
의존 관계 명시
// turbo.json "boundaries": { "tags": { "app": { "dependencies": { "deny": ["app"] } }, "library": { "dependencies": { "deny": ["app"] } }, "infra": { "dependencies": { "deny": ["app", "library"] } }, "config": { "dependencies": { "deny": ["app", "library", "infra"] } } } },패키지 경계 규칙: config → infra → library → app (하위 → 상위)
- config: tsconfig, tailwind-config
-
- infra: env, hmr, dev-utils, zipper, vite-config
- library: shared, ui
- app: chrome-extension, web, app, side-panel, options, content-ui, e2e
- 각 패키지 설정
// tailwind-config/turbo.json
{ "extends": ["//"], "tags": ["config"] }
- CI에서 검사
- name: Package boundaries
run: turbo boundaries --filter="./packages/*"
- turbo devtools
의존 관계 그래프
- remote cache
- vercel link로 vercel에 연결
- github actions에서 환경 변수 설정
// .github/workflows/ci-cd.yml
jobs:
ci:
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
- 로컬에서 빌드 → Vercel에 캐시 파일 PUT으로 저장 → CI환경 혹은 다음 빌드 시 서버에서 이를 GET
이미지