boundaries
ExperimentalBoundaries ensure that Turborepo features work correctly by checking for package manager Workspace violations.
This feature is experimental, and we're looking for your feedback on the Boundaries RFC.
This command will notify for two types of violations:
- Importing a file outside of the package's directory
- Importing a package that is not specified as a dependency in the package's
package.json
Tags
Boundaries also has a feature that lets you add tags to packages. These tags can be used to create rules
for Boundaries to check. For example, you can add an internal
tag to your UI package:
And then declare a rule that packages with a public
tag cannot depend on packages with an internal
tag:
Alternatively, you may want public
packages to only depend on other public
packages:
Likewise, you can add restrictions for a tag's dependents, i.e. packages that import packages with the tag.
Tags allow you to ensure that the wrong package isn't getting imported somewhere in your graph. These rules are applied even for dependencies of dependencies, so if you import a package that in turn imports another package with a denied tag, you will still get a rule violation.
Was this helpful?