Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(boundaries): boundaries tags #9900

Merged
merged 16 commits into from
Feb 10, 2025
Merged

Conversation

NicholasLYang
Copy link
Contributor

@NicholasLYang NicholasLYang commented Feb 4, 2025

Description

Implements boundary tags by adding a boundaries field to turbo.json. This field allows you to specify an allowlist and denylist for both dependencies and dependents. The deny list takes precedence over the allowlist (like with our globs).

The commit history should be good enough to review one by one, in theory lol.

Testing Instructions

Added some tests both in existing boundaries fixture and in a new boundaries_tags fixture.

Copy link

vercel bot commented Feb 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-basic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 10, 2025 5:25pm
examples-designsystem-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 10, 2025 5:25pm
examples-gatsby-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 10, 2025 5:25pm
examples-kitchensink-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 10, 2025 5:25pm
examples-native-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 10, 2025 5:25pm
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 10, 2025 5:25pm
examples-svelte-web 🔄 Building (Inspect) Visit Preview 💬 Add feedback Feb 10, 2025 5:25pm
examples-tailwind-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 10, 2025 5:25pm
examples-vite-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 10, 2025 5:25pm

@NicholasLYang NicholasLYang force-pushed the nicholasyang/boundaries-tags branch from c97c095 to 6eb5f02 Compare February 5, 2025 15:44
@NicholasLYang
Copy link
Contributor Author

@anthonyshew, basically we now define rules at the root level and those rules operate on tags, not on individual packages. So to declare that a web tag can only depend on ui tags, we declare:

{
    "boundaries": {
        "tags": {
            "web": {
               "dependencies": {
                    "allow": ["ui"]
                }
            } 
        }
    }
}

To additionally reject packages with the unsafe tag, we put:

{
    "boundaries": {
        "tags": {
            "web": {
               "dependencies": {
                    "allow": ["ui"],
                    "deny": ["unsafe"]
                }
            } 
        }
    }
}

@anthonyshew
Copy link
Contributor

That works for me. I'm of the mind that we should put this into people's hands and get feedback!

@NicholasLYang NicholasLYang merged commit 5f255df into main Feb 10, 2025
39 checks passed
@NicholasLYang NicholasLYang deleted the nicholasyang/boundaries-tags branch February 10, 2025 21:58
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.

3 participants