Skip to content

Conversation

@wesleytodd
Copy link
Member

Added logic to detect when used within a monorepo context and act accordingly. This includes:

  1. a new workspaceRoot option to avoid the lookup logic
  2. a new Workspace root: prompt that only shows when it thinks you are running anywhere other than the workspace root
  3. initializing a workspaces key with suggested packages it find
  4. adding the new package to a root package.json workspaces key if it wasn't already matched
  5. running a final npm i if necessary to ensure lock files are updated with the new workspace package

This one is a tricky one from a semver perspective. I think it should be a minor, but since it looks up the filesystem tree it absolutely could be breaking if it used to be called in a monorepo context where this handling was done outside the package. This can be avoided by simply passing --workspace-root=$(pwd) to tell it to look no further. Because of this, I am considering if that should be set by default despite not being super ergonomic. Then we can say "this will change in the next major to be on by default". Honestly not sure how to think about this, but I think erring on the side of caution is never bad so will consider this before landing. Feedback welcome.

@wesleytodd wesleytodd requested review from a team and removed request for a team December 16, 2025 01:03
@wesleytodd wesleytodd requested a review from a team December 16, 2025 01:07
@wesleytodd wesleytodd force-pushed the monorepo branch 2 times, most recently from 79a595b to 7c641be Compare December 17, 2025 01:47
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.

4 participants