wix-incubator / lerna-script

Lerna addon for adding custom tasks
MIT License
164 stars 13 forks source link

latest not working on "older" versions #404

Open Enrice opened 4 years ago

Enrice commented 4 years ago

say I have a fixed version dependency of

  "managedDependencies": {
    "package1": "1.1.0"
  },
  "autoselect": {
    "versionDiff": [
      "patch"
    ]
  }

in my release git branch.

meanwhile, my develop git branch has moved forward to be using

  "managedDependencies": {
    "package1": "1.2.0"
  },
  "autoselect": {
    "versionDiff": [
      "patch"
    ]
  }

now I had to port back some changes to package1, so it gets a new version "1.1.1".

the problem is: above execution of "latest" won't find this version in the remote registry (artifactory pro, it's correctly published there). package1 stays "1.1.0" on "latest", the output is as follows:

info lerna-script executing task: "latest"
info latest checking for latest dependencies
info latest
info latest nothing selected, exiting...

what am I doing wrong? is this a bug?

Enrice commented 4 years ago

I think this could be resolved with dist-tags. we should be able to parameterize and not only use "latest" but any dist-tag, which I did in the PR.

Enrice commented 4 years ago

Thinking about it again, it would be even better if we would not have to specify a dist-tag at all, but parse the versions of all available dist-tags for a matching version! Given that it was previously published with a specific dist-tag like so:

lerna publish --dist-tag=<tag>