Skip to content

fix: prevent non-private packages from having private workspace production deps#865

Merged
rekmarks merged 2 commits intomainfrom
rekm/no-private-deps-in-public-packages
Mar 4, 2026
Merged

fix: prevent non-private packages from having private workspace production deps#865
rekmarks merged 2 commits intomainfrom
rekm/no-private-deps-in-public-packages

Conversation

@rekmarks
Copy link
Member

@rekmarks rekmarks commented Mar 4, 2026

Summary

  • Add a yarn constraint that prevents published (@metamask/) packages from listing private (i.e., practically speaking, @ocap/) workspace packages in production dependencies (dependencies or peerDependencies) via the workspace: protocol
  • No current violations exist; this is a guardrail against future mistakes

Test plan

  • yarn constraints passes with no errors
  • Temporarily add a private @ocap/ package to a public package's dependencies with workspace:^ and verify the constraint catches it: see DO NOT MERGE: #865 test #867

🤖 Generated with Claude Code


Note

Low Risk
Low risk: adds a Yarn constraints guardrail only, and it triggers only on invalid dependency declarations for published packages.

Overview
Adds a new Yarn constraint that fails yarn constraints when a non-private (published) workspace declares a workspace: protocol dependency on a private workspace in production dependency sections (anything other than devDependencies, e.g. dependencies/peerDependencies).

Implements expectNoPrivateWorkspaceProductionDependencies and runs it for all non-private child workspaces, emitting a clear error message naming the offending package and dependency type.

Written by Cursor Bugbot for commit 782e72c. This will update automatically on new commits. Configure here.

@rekmarks rekmarks requested a review from a team as a code owner March 4, 2026 00:26
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Base automatically changed from rekm/public-kernel-platforms to main March 4, 2026 00:30
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 76.11%
🟰 ±0%
6639 / 8722
🔵 Statements 76%
🟰 ±0%
6745 / 8874
🔵 Functions 73.95%
🟰 ±0%
1653 / 2235
🔵 Branches 75.38%
🟰 ±0%
2472 / 3279
File CoverageNo changed files found.
Generated in workflow #3872 for commit 782e72c by the Vitest Coverage Report Action

rekmarks and others added 2 commits March 3, 2026 17:19
…ction deps

Add a yarn constraint that errors when a published (`@metamask/`) package
lists a private (`@ocap/`) workspace package in production dependencies
(`dependencies` or `peerDependencies`) via the `workspace:` protocol.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rekmarks rekmarks force-pushed the rekm/no-private-deps-in-public-packages branch from a02f7a4 to 782e72c Compare March 4, 2026 01:21
@rekmarks rekmarks enabled auto-merge March 4, 2026 01:21
Copy link
Contributor

@FUDCo FUDCo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beeld eet.

@rekmarks rekmarks added this pull request to the merge queue Mar 4, 2026
Merged via the queue into main with commit d40ace1 Mar 4, 2026
29 checks passed
@rekmarks rekmarks deleted the rekm/no-private-deps-in-public-packages branch March 4, 2026 01:27
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.

2 participants