Conversation
🦋 Changeset detectedLatest commit: 0bbcc29 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
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❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## next #1655 +/- ##
==========================================
- Coverage 82.52% 82.47% -0.05%
==========================================
Files 53 53
Lines 2357 2357
Branches 697 697
==========================================
- Hits 1945 1944 -1
- Misses 370 371 +1
Partials 42 42 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi @bluwy any update on merging this? |
|
I haven't finished the tasks I mentioned in my last comment, but I'm also unfortunately not interested in updating anymore given I had no reviews when it was ready. If anyone would like to help out, that'd be much appreciated. |
|
This is a prerequisite to this work: #1872 . I'll land this soon to unblock this work here, see the discussion that led to this PR here: #1795 (comment) |
|
@marcalexiei I know you were interested in this work. I just updated this PR after landing your work. There are known type errors here because the Changesets' Treating it as
The new requirement is more strict but I think it's ultimately more correct. We might want to differentiate further in the future between npm-managed workspaces and root-only repositories without lockfiles.
This was largely addressed by #1872 , WDYT?
I thiiiink Rush might not support the root package in the same sense as other tools support it today. Its workspaces might be defined in its own config file or something. But honestly, I'd have to do a deeper research on this to answer this properly.
This was also addressed by #1872 |
4df8533 to
02a1897
Compare
How about using a
Would you like me to open a PR on this branch using this approach? |
|
This was a simple fix - so I think it wasn't worth opening a different PR for this. I just pushed it out here. Do you think it's worth keeping up with manypkg's compatibility or at this point it's just making things more complicated than they should be? I'm torn on this - but also, manypkg is also controlled by us so we can refactor it however we want to suit our needs. So ultimately, it's kinda a choice of:
|
|
Changesets is the main consumer followed by backstage. Not sure we need to worry too much about anyone else
|
Perfect, thank you!
Personally, I’d lean toward option 1 (landing this PR and settling on this approach). The main advantage is that moving to an object-based I’m not sure yet what we might need for tools like Rush, but this keeps that door open. It also enables more tool-specific extensions in a type-safe way. For example: type Tool =
| { type: 'pnpm'; pnpmMethod: () => void }
| { type: 'yarn'; yarnMethod: () => void }
| { type: string | {} };
function isToolTypeKnown(x: Tool): x is Extract<Tool, { type: 'pnpm' | 'yarn' }> {
return x.type === 'pnpm';
}
const tool = {} as Tool;
if (isToolTypeKnown(tool)) {
if (tool.type === 'yarn') {
tool.yarnMethod();
} else {
tool.pnpmMethod();
}
}If this direction works well in practice, we could then revisit whether |
|
That sounds good to me. I'll wait a couple of days before landing this to give @bluwy the chance to comment too. |
|
We still need to remember to update the bot. If you'd be interested in helping with that, I'd really appreciate it. |
I can take a pass at this. I’ll open an issue in the bot repo with all the relevant references so we don’t lose track (I remember you already pointed out the parts that need updating). Sounds good? |
|
Sounds good! thanks 🙏 |
I'll leave it to y'all to handle this as I don't have much time to follow-up on this lately. |
Some code added to handle the breaking change, mainly the
Packagenow needs to specifydirandrelativeDir. And thetoolneeds to be a tool from@manypkg/toolsand not just a string.There are a lot of line changes adding
package-lock.jsonto the fixtures because that's the only way for it to detect as monorepo (npm). Previously a"workspaces"only field was sufficient. @Andarist I'm not sure this is the most ergonomic, shouldn't npm monorepos be detected as fallback without the need forpackage-lock.jsonto exist?Unrelated but if I may give feedback on the new breaking APIs, I'm not a big fan of passing the
toolobject entirely from@manypkg/tools. It should've supported a simple string like before and a union of Tool object instead.Also, I'm not entirely clear for
Packagestype, why the returnedrootPackagecould be undefined whilerootDiris not?rootPackageshouldn't be possible to be undefined from what I can tell (at least for default tools).Also, I'm not sure if it was necessarily to introduce both
dir(absolute) andrelativeDir(relative) in the object. Feels redundant.