Omit private packages from lists of changed and unchanged packages offered by the CLI when running `yarn changeset`
See original GitHub issueAffected Packages
Problem
The list of packages offered by yarn changeset
includes private packages (i.e. packages with private: true
in package.json). In projects with broad contribution, contributors may not be aware that only packages that get published should be included in changesets, and include those private packages. This creates noise for maintainers, who have to explain the issue and ask the contributor to fix the changeset.
Proposed solution
If a package is marked as private, it shouldn’t be included in the lists of changed and unchanged packages offered by the CLI. This behavior could be behind an optional flag if there are workflows where including private packages in this list makes sense.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:13
- Comments:10 (9 by maintainers)
Top Results From Across the Web
@changesets/cli | Yarn - Package Manager
Helps you manage the versioning and changelog entries for your packages, with a focus on versioning within a mono-repository (though we support single-package...
Read more >How can I version bump all my dependencies? - Stack Overflow
If you want your package.json to be updated: Change all your dependencies to a fixed version ( "x.x.x" ); Run yarn to update...
Read more >Nixpkgs 22.11 manual - NixOS
This chapter describes how to extend and change Nixpkgs using overlays. Overlays are used to add layers in the fixed-point used by Nixpkgs...
Read more >Commands.dev - Find commands at the speed of thought
Commands.dev is a searchable, templated catalog of popular terminal commands curated from across the internet.
Read more >rollup.js
Rollup should typically be used from the command line. You can provide an optional Rollup configuration file to simplify command line usage and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There is also
file:
protocol and it’s supported by npm. So this could potentially still be used there.You may still need to reference a private package in dev dependencies of a public package - and referencing a private package from a private package doesn’t look that different to me, or am I missing something? 🤔
Yes, this would have to be taken into account in the system as a whole. It’s hard for me list all the exact places right now though - but hopefully this should limit itself to just a couple of places.
I’ve recently opened a PR to fill the missing version ( https://github.com/changesets/changesets/pull/705 ) and this has prompted the discussion that maybe instead of doing that we should ignore private package without a version. The version will still be required for publishable packages though - and we might want to throw when a version is missing in such a package.
@Andarist I have implement changes locally, however, I think that will be a major change because people will no longer see private packages in the list displayed by CLI which can be a pain for them if they are creating changesets for private packages as well.
To avoid breaking changes I can work on introducing a new config option -
skipPrivatePackages
which will befalse
by default, fully preserving current behavior of the CLI. WhenskipPrivatePackages
will be set totrue
private packages will be totally omitted by CLI.There are multiple ways new config option can be added, so I’ll be grateful to hear maintainers opinion on this.
We don’t use changesets now, but we have a use case for generating changelog for private packages. We are moving to micro-frontends and each micro-frontend is a npm package, which never gets published. Instead we just deploy content of
dist
folder to S3 and update import-map in html. We even want to prohibit users from publishing micro-frontends to npm, so we haveprivate: true
set in package.json.BTW, thank you for nice code in the repo. During implementing changes I realized that I do not feel like I am working in a “foreign” repo, which was awesome!