Force publish only specific package(s)
See original GitHub issueExpected Behavior
Pass --force-publish
and some other flag to only force publish specific or multiple packages, but not all. One may say to use with --ignore-changes
but it seems to not work, meaning that it treats all the packages and seems to ignore the ignore-changes
flag completely.
The use case is when you have dist
changed but not sources, but you know for sure that the dist
is different (has changed) and want to bump version.
Current Behavior
No way of doing it? --force-publish
and --ignore-changes
doesn’t play well together.
Possible Solution
Don’t know.
Steps to Reproduce (for bugs)
- Have 5 or 10 packages
- Want to force publish only 2-3
- ignore the rest
Removed the rest of the issue template, since it doesn’t apply.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
It's possible to publish a specific package with Lerna?
If they are both independent, and you don't want to publish them at the same time, then don't use lerna, it's clearly not...
Read more >Version and Publish - Lerna
We are going to publish the header and the footer packages. It's common to publish only a subset of the projects. Some projects...
Read more >Untitled
`publish` will help publish any updated packages. ... dist-tag is used at the start to prevent the case where only some of the...
Read more >@lerna/publish - npm
publishConfig.access. To publish packages with a scope (e.g., @mycompany/rocks ), you must set access : ; publishConfig.registry. You can customize the registry ...
Read more >@lerna/publish | Yarn - Package Manager
Publish packages in the current project ... publish: support inconsistent workspace prefix usage (#3413 (da2274b); version: only apply prettier if it was ...
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
I’d say the version of
lerna
that you’re using is rather applicable. As is the exact command(s) you attempted. And what (if any) configuration is present inlerna.json
.I’ll practice reading your mind, I guess. Hand-waving, I assume you tried something like this:
One thing to note, if you do ignore everything except an explicit subset, any changes outside of the subset will be forever lost to subsequent publishes, as far as Lerna is concerned. That is, the next time you run
lerna publish
without all the fancy forcing, it won’t consider the previously-ignored packages to have changed, and thus won’t publish them.I would recommend you avoid using the
--ignore-changes
flag for this purpose, and just accept that Lerna will publish what has changed since the previous release tag in addition to the stuff you forced (which is valid in this case, for sure, build changes and whatnot won’t get recognized).It’s literally how tags work in git? That’s what Lerna uses to determine what changed since the last release. The “last release” is the previous annotated git tag.
You can always pass specific globs to
--force-publish
if you don’t want to version the world. It has the same caveats when combined with--ignore-changes
, however, and is generally only used to ensure certain packages always get published (Babel itself uses this for some of their packages due to a weird dependency graph).