Tag private packages when their version changes#662
Tag private packages when their version changes#662Andarist merged 31 commits intochangesets:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 7bdce4a The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 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 |
|
@gakonst @Andarist @mitchellhamilton here is another attempt, I think it addresses (or is closer to addressing) Mitchell's feedback on the other approaches. |
|
With this approach we would need to fetch tags as well, otherwise it will continually trigger releases |
|
I would love this feature for tagging private packages. I have a combination of private and public. I thought this would come out of the box with Changesets, but sad to see that only published packages is getting tagged... |
|
@vemundeldegard could you describe your use case? With more data we’ll be able to take a better/more informed final decision about this |
Sure! In our project we have a couple of private packages and a couple of public packages. The private packages are basically a handful of AWS Lambdas which are not released to NPM. We want to use Changesets because it offers a handy developer experience for managing versioning and changelog. My understanding is that Changesets do update and merge the changelogs for private our private packages, but as soon as it doesn't merge something to NPM, it will not create a new tag and a GitHub release. Please correct me if this is not right.. The above is the main drawback for us, because we use the releases to trigger additional steps in our workflow, such as deploying the Lambdas. It has forced us to only use the |
|
@Andarist should I rebase this? It incorporates the feedback from @mitchellhamilton has for the previous 3 attempts |
|
This looks neat and would address the question asked by me in #745 🙂 |
9aa8191 to
99d337c
Compare
miszo
left a comment
There was a problem hiding this comment.
@JakeGinnivan, I guess that besides the little duplication, the implementation looks good.
|
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 7bdce4a:
|
2c0f53a to
0a652ea
Compare
|
I would also be interested to see this one released. |
0a652ea to
7e4af7f
Compare
|
Rebased on main. |
|
@JakeGinnivan, @Andarist – can we proceed and merge this pull request? Are there any blockers or other reasons that suggests that this change shouldn't be merged? |
7e4af7f to
25d4047
Compare
|
I've rebased again, I am referencing the packages built by codesandbox directly in a number of projects. |
|
I think that:
|
Eventually I think this function should not actually publish, instead return the packages which should be published then have multiple publish strategies like publish to NPM, run command etc. This will allow these private packages to maybe have a
Added a config flag |
Further to this, tagging is done outside of the publishPackages function. So I need to return the unpublished private packages so I don't need to duplicate the tagging code |
25d4047 to
f2029e8
Compare
Co-authored-by: Mateusz Burzyński <[email protected]>
046da53 to
3e9f3b9
Compare
| return false; | ||
| } | ||
|
|
||
| if (!config.privatePackages && packageJson.private) { |
There was a problem hiding this comment.
is something wrong here? because config.privatePackages is always Object
!config.privatePackages?.version && packageJson.privateor i misunderstand?
There was a problem hiding this comment.
@mino01x is it causing an issue? If it is then we need to write a test around it
There was a problem hiding this comment.
#985 yes i have create a pr. you can help me to check it.
| @@ -0,0 +1,17 @@ | |||
| import { Config } from "@changesets/types"; | |||
| import { PackageJSON } from "@changesets/types"; | |||
There was a problem hiding this comment.
import type { PackageJSON } from "@changesets/types";
I think both import can be type import

Replaces #420 and #569. Also addresses comment in #478 (comment)
This updates the publishPackage function so it returns 2 things, the publishedPackages and the untaggedPrivatePackages. I wasn't sure how far to take the separation, it could have been it's own module.
Possibly a further step would be to gather up the
projectswhich need to be published & tagged. This would allow changesets to be extended to publish .NET packages to NuGet for instance.This could also be considered as a breaking change. We possibly should add a new config option to opt into this?