Add restrictions to packages access #10728
Replies: 2 comments 1 reply
-
1. Introduction1.1 PurposeThis document describes the detailed design and technical flow for a new feature in TurboRepo: package-level restrictions via a 1.2 Scope
1.3 Audience
2. Background & Motivation
3. Configuration Schema{
"package_restrictions": {
"<package-alias>": {
"include": ["<allowed-app-or-package>"],
"except": ["<denied-app-or-package>"]
}
// ... more packages
}
}
Rules:
4. Technical Design4.1 Integration Point
4.2 Data Structures
4.3 Validation Algorithm
4.4 Error Handling & Messaging
4.5 CLI & Flags
4.6 Caching & Performance
4.7 Documentation & Developer Experience
5. Flow Diagramflowchart LR
A[Start turbo run] --> B[Load turbo.json]
B --> C[Parse package_restrictions]
C --> D[Build dependency graph]
D --> E[For each edge: validateRestrictions]
E -->|allowed| F[Continue build]
E -->|rejected| G[Report error + exit]
F --> H[Execute tasks]
G --> I[Abort]
Product Requirements Document (PRD)PRD 1. OverviewFeature Name: Package Restrictions Enforcement Objective: Empower monorepo maintainers to enforce architectural boundaries by restricting which workspaces can depend on specified packages. PRD 2. Key Stakeholders
PRD 3. User Stories
PRD 4. Functional Requirements
PRD 5. Non-Functional Requirements
PRD 6. Acceptance Criteria
PRD 7. Timeline & Milestones
|
Beta Was this translation helpful? Give feedback.
-
|
Please see our (currently open at the time of this writing) Boundaries RFC: https://turborepo.com/docs/reference/boundaries#tags |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-goals
Background
Currently using "package name": "workspaces:*" can access that package. This feature is to achieve safety and prevent some specific apps or packages to use the restricted package.
Proposal
Add package_restrictions mapping inside turbo.json. By default all packages are accessible by all apps and packages.
Eager to contribute, but unfortunately I am too busy these days... Looking forward to seeing this feature.
Beta Was this translation helpful? Give feedback.
All reactions