-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat(version): add support for changelog #2358
Conversation
@arcanis The more I work on this the more I realize we should modify (or have a flag for) So, I audaciously went ahead and tried to use berry/packages/plugin-version/sources/versionUtils.ts Lines 37 to 40 in 84627d8
As I said, I could imagine if this is intentional, it means the changeset is per commit. But would be nice to have one changeset per PR. Let me know if I completely misunderstood things here 😄 But eager to hear what you think! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice! Do you know if Ink supports a way to display an input box with a series of dots, instead of taking three rows? I quickly checked but didn't find anything 🤔 cc @vadimdemedes
releases: | ||
"@yarnpkg/plugin-version": minor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No changelog? 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arcanis just in the draft mode now, I will add it when I add support for changelog generation next. Will gladly be the first try-er of this feature 😄
I don't know what you meant by |
I meant something a bit like this: https://manaflair.github.io/mylittledom/demo/#complex-form This way it would take a bit less vertical space. Not critical, but if there's a way ... 😄 |
Just saw this - I'm not sure I follow. We fetch the list of changed files between master and the current HEAD, but that list includes any commit between the two of them (otherwise I wouldn't get the right result when running the edit, as you mentioned, but it works fine). The workflow you mentioned should already work 🤔 |
This way it would take a bit less vertical space. Not critical, but if there's a way ... 😄 @arcanis awesome work there! Of course, I wouldn't mind aiming for the best possible way. I myself don't link the current border-box because when you resize it looks bad (until you type the next character - or have some I have looked at the doc for Doing that way, we also have to think about text-wrapping. Looks like for Also, while we're here, there's a problem with multi-line changelog. Since we block on Anyway, I'm all over the place here. I'll see what I can do: I will highly likely skip this in first-pass. tl;drIf it's too time-consuming to go the If vertical space is of your concern, we can use |
@arcanis Just to be on the same page (because I'm so new to contributing as well), my workflow is:
So in this scenario: According to the doc for [merge-base] when we call berry/packages/plugin-version/sources/versionUtils.ts Lines 37 to 40 in 84627d8
We will get HEAD as the merge-base, instead of the commit where I fork This means that on my local, if I have made several commits, but my current git working directory is clean right now, when I call |
I think that's the problem. The idea (which perhaps should be better documented!) is that when working on a feature you first create a feature branch. Typically in this repo we call them To sum up, a better experience would be to:
|
@arcanis I see, so to accommodate for the workflow that I mentioned (i.e. develop on fork |
Just a quick status update. I will come back to this in a week or two due to a tight schedule. Sorry to anyone who's waiting on this for the delay. |
@akphi looks wonderful - would love to use this feature one day in my projects. Any chance you find time to finalize this? |
@fmal I totally forgot about this 😭. My motivation was to make this work better with changesets and I managed to tinker a bit to just make |
Hi @akphi 👋 thanks for tackling this — much needed feature. So is your latest approach to just leverage changesets under the hood? |
@emilio-martinez The main motivation for me to start all of this is that I cannot use Regardless, I'll find some time to come back to this. I think since the last time I was discussing with @arcanis I got a pretty good understanding of what it takes. |
I'm going to close this PR here. We have moved on to use I'm still following the original thread #1510 and still believe being able to align |
Thanks to @akphi's efforts, I think the requirement of this feature seems to be more clear after this PR. I've been working on this issue for a few days now, but since I didn't join the discussion, my understanding of all this comes from #1510, there's no consensus on this feature yet, right? I have some insights and would like to ask you if I am on the right track🥸. 1 PR = 1 version file mapping do not change (at least in the first iteration)
After working on it, I think one input box is not enough, because version files may only be partially iterated over in Yarn. For example:
---
"@yarnpkg/cli": minor
- "@yarnpkg/core": minor
---
Does something new We have no way of knowing which package this changelog is from, so I think each package should have its own changelog, here comes the problem, I think there are multiple input boxes in the "yarn version check -i", which seems to be bad for DX, also, Ink doesn't seem to have a good textarea component. So I want "yarn version check-i" to not pay attention to updating the changelog.
I think the conversion to markdown is a very good practice, because markdown is quite suitable for manual editing changelog. However, if we consider this matter together with the first and second points, how to use the ecosystem of changeset will be a difficult problem.
I think it makes sense that maybe yarn shouldn't care about this and just go manage everything in But as a loyal yarn user, I think it would be great if yarn version deferred could support changelog🤪. So I can convince myself that yarn is a package manager, and package manager is related to package version, and package version is related to changelog, so yarn and changelog are related. Maybe it should be maintained by a third party? I'm not so sure, But given the context, I would expect it to be a plugin independent of yarn version plugin, partly to make it easier for it to be extracted from the yarn repo (if needed in the future), partly to avoid huge conflicts (the yarn team seems to be rewriting the yarn version plugin #4867) In addition, it seems to be easier to integrate changeset's ecosystem when it is independent. The tentative idea is adding some hooks to yarn version plugin. 1 PR = 1 version file mapping. changelog is manually edited by the user. only works when version deferred I'm really not very good at English and I'm still learning, so I'm sorry if I caused you any difficulty in reading |
@jj811208 Whew, that's quite a lot. I'm afraid I only have answers for a few points though. Regarding points 1 and 2, I think when user wants to create a new changeset, showing only 1 input box makes sense. Overall, I often find myself in 2 situations:
With that, I feel like showing one input box is the only way to address these needs. If one wish to create multiple changesets like in case (1) feel free to call the command multiple times Regarding point 4, I'm not sure about what you said, I think one of the requirements is when call Anyhow, I think you have some nice ideas there, and some I can't really answer 😅 , so for the benefit of everyone, let's bring this discussion back to #1510 if possible. Thanks! |
Thank you for your reply! I feel a lot of uncertainty with this initial idea, and I'm worried that it will be communicated to too many people. But when I'm ready I will! |
What's the problem this PR addresses?
This PR aims to introduce a fairly basic changelog generation feature for version plugin
Fixes #1510
How did you fix it?
I followed the guidance listed in #1510 (comment) and referred to the approach and the UX of changesets.
Checklist
TODOs - will find some time to work on these, I'm pretty slammed this week 😭
markdown
instead ofyaml
) - right now I just add achangelog
field to the existingyaml
file.CHANGELOG.md
file.Things to consider - @arcanis