Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Configure and optimize Turborepo monorepo build pipelines with correct task structure, caching, and CI setup.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/boundaries/RULE.md
1# Boundaries23**Experimental feature** - See [RFC](https://github.com/vercel/turborepo/discussions/9435)45Full docs: https://turborepo.dev/docs/reference/boundaries67Boundaries enforce package isolation by detecting:891. Imports of files outside the package's directory102. Imports of packages not declared in `package.json` dependencies1112## Usage1314```bash15turbo boundaries16```1718Run this to check for workspace violations across your monorepo.1920## Tags2122Tags allow you to create rules for which packages can depend on each other.2324### Adding Tags to a Package2526```json27// packages/ui/turbo.json28{29"tags": ["internal"]30}31```3233### Configuring Tag Rules3435Rules go in root `turbo.json`:3637```json38// turbo.json39{40"boundaries": {41"tags": {42"public": {43"dependencies": {44"deny": ["internal"]45}46}47}48}49}50```5152This prevents `public`-tagged packages from importing `internal`-tagged packages.5354### Rule Types5556**Allow-list approach** (only allow specific tags):5758```json59{60"boundaries": {61"tags": {62"public": {63"dependencies": {64"allow": ["public"]65}66}67}68}69}70```7172**Deny-list approach** (block specific tags):7374```json75{76"boundaries": {77"tags": {78"public": {79"dependencies": {80"deny": ["internal"]81}82}83}84}85}86```8788**Restrict dependents** (who can import this package):8990```json91{92"boundaries": {93"tags": {94"private": {95"dependents": {96"deny": ["public"]97}98}99}100}101}102```103104### Using Package Names105106Package names work in place of tags:107108```json109{110"boundaries": {111"tags": {112"private": {113"dependents": {114"deny": ["@repo/my-pkg"]115}116}117}118}119}120```121122## Key Points123124- Rules apply transitively (dependencies of dependencies)125- Helps enforce architectural boundaries at scale126- Catches violations before runtime/build errors127