-
Notifications
You must be signed in to change notification settings - Fork 736
feat(cli): allow changesets to be executed from nested non-root folders (#545) #1806
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
base: main
Are you sure you want to change the base?
feat(cli): allow changesets to be executed from nested non-root folders (#545) #1806
Conversation
🦋 Changeset detectedLatest commit: 0254443 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1806 +/- ##
==========================================
+ Coverage 81.33% 82.31% +0.97%
==========================================
Files 54 54
Lines 2277 2290 +13
Branches 684 686 +2
==========================================
+ Hits 1852 1885 +33
+ Misses 420 400 -20
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5aa603c to
4fbd2bd
Compare
Context
Allows changesets to be executed from deeply nested folders within a monorepo that has the .changeset folder at the root of it.
A common example of this is a monorepo with two packages: frontend and backend. These packages might have different scripts that people run within those folders. When they finish some piece of work, they have to change directories back to the root to create a changeset.
This change helps exactly with that, but also, with most of the changeset commands.
Implementation details
I've added a new package to determine the root of the project: @manypkg/find-root. This package gets dynamically imported when the current directory doesn't have a changeset folder. Then, it will try to determine if the root has a changeset folder or not. Otherwise the same behavior as always executes, which is throwing an error.
Questions/Unknowns
The new package is an ES module and therefore I've had some issues using it here, in terms of typings, execution, and testing.
My question is, are we ok with this? I'm open to other ideas or suggestions.
Related issue: #545