Upgrade manypkg/get-packages#1069
Conversation
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 07c516b:
|
| let releasedPackages: Package[] = []; | ||
|
|
||
| if (tool !== "root") { | ||
| if (tool.type !== "root") { |
There was a problem hiding this comment.
We will have to also update this in changesets/action:
https://github.com/changesets/action/blob/595655c3eae7136ff5ba18200406898904362926/src/run.ts#L95
There was a problem hiding this comment.
changesets/action should be built on top of @changesets/release-utils - but this wasn't yet unified.
There was a problem hiding this comment.
Got it, will check it out.
As an aside, could be interesting to explore moving the source code for actions into the monorepo as a package. We've had some success with this with action collections in monorepos.
The "publish" command, instead of being NPM-based, becomes git-based: you build the action, bundle dist up into a single file (with @vercel/ncc or your favorite equivalent), and then your calculated version (e.g. 4.1.0) becomes the branch name... you push the files directly into branch v4.1.0 in the target repo, changesets/action.
(To follow GH conventions, you usually also have branches for major versions, so you follow it up by chopping off and fast-forwarding, e.g. git checkout v4 && git reset --hard v4.1.0 && git push -f in the target repo.)
This also brings up the whole question of "well... what if I wanted changesets to manage publishing all my actions, using this alternate publishing scheme?". That's a question we never really dug into Rush but I've always thought it would be cool if it was as simple as:
[
{
"packageName": "@example/core",
"shouldPublish": true,
"publishMethod": "pnpm"
},
{
"packageName": "@example/custom-action",
"shouldPublish": true,
"publishMethod": "github-action",
"targetRepo": "example-company/custom-action"
}
]
And then you'd just "publish all" and everything is done for you.
There was a problem hiding this comment.
Ye, it would be kinda neat if the changesets/action repo could just become a publish target.
| snapshot?: string | boolean | ||
| ) { | ||
| let cwd = packages.root.dir; | ||
| let cwd = packages.rootDir; |
There was a problem hiding this comment.
If I'm not mistaken - this is a breaking change for @changesets/apply-release-plan. This is fine - we just have to create a major changeset for it
There was a problem hiding this comment.
Is it major? I might misunderstand the ramifications but I think apply-release-plan's external behavior for all existing monorepo implementations doesn't change (it's just a dependency bump + corresponding implementation tweak).
There was a problem hiding this comment.
The problem is in the API surface - not the behavior. It now accepts an argument of a different shape
|
Could we also add a test that would check |
| expect(await getCommitCount(clone)).toBeGreaterThan(5); | ||
| expect(await getCommitCount(clone)).toBeLessThan(originalRepoDepth); | ||
| }); | ||
| }, 10_000 /* 10 seconds */); |
There was a problem hiding this comment.
Hm, quite interesting that you are hitting timeouts here - somewhat similarly to what happened in manypkg repo. There is likely some overhead in spawn here but I never had problems with this - even on the older machine.
There was a problem hiding this comment.
🤔 I wonder why... on the other repo, upgrading that ts wrapper tool made the timeout issues vanish.
But in this case, it's only this specific test that consistently goes over 5 seconds for me, and it's the test that calls git 50+ times so it made sense to me that it was a bit slower.
There was a problem hiding this comment.
Out of curiosity - could you check how long those spawn('git', ...) calls take on your machine? It would be interesting to learn more about this particular bottleneck. This is, of course, just a sideways exploration - not quite related to this PR.
|
@elliot-nelson just curious, is this effort still being pursued? |
|
@akphi ye, definitely |
|
Thanks for ping though looks like this is stalled on me 😅 I'll get those 2 additional tests added in next couple days. |
|
@elliot-nelson did you have chance to look at this again? |
|
I think this will also fix this bug: #1209 What is left here? I cannot see the circleCI pipeline, so not sure what's broken. Can I somehow help get this over the finish line? |
|
Anything we can do to help get this released? I'm at a standstill with a pnpm monorepo. @elliot-nelson |
|
@Andarist 👋 Hi Andarist, long time no chat :). I've added tests that shows basic |
|
Hi @Andarist , I'm wondering if you could have a look at this old PR? The latest manypkg release cuts a bunch of dependencies.
|
|
I know it's been a while, but if there's still interest in the PR, we've created a |
|
There's now For now, I'll close this one, but thanks for contributing! |
SUMMARY
@manypkg/get-packages@manypkg/toolscollectionDETAILS
get-packages.tool.typeinstead oftool.@manypkg/toolsso they can use prefab tool implementations. (It's not required -- you could define your own fake monorepo implementation inline for testing -- but this was the easiest way to confirm that the previous intent was still being met.)For the most part, there should be no functional changes in this PR except those introduced in the latest version of
get-packages:Note that for Rush specifically, changeset publish needs more work, which will come in a separate dedicated PR.
TESTING