autorest.typescript icon indicating copy to clipboard operation
autorest.typescript copied to clipboard

[Track 2] Keep versions of dependencies up to date

Open sarangan12 opened this issue 4 years ago • 3 comments

For the Track 2 SDK generator(for the new services) when they are generated we have a package.json file. In that file, under the dependencies section, we have core packages such as core-lro core-auth core-client etc. These packages are set to some version.

  1. But these packages are released independently and could have updated to new versions. Such changes are not reflected immediately in the generator.
  2. When these new services are included in the JS SDK repository, it has to be in sync with version dependency of other packages. Such dependencies can be at par with the generated dependencies, much newer or older than the generated dependencies.

Both the above issues cause the developer to manually intervene and change the dependency version. This is minor intervention. But, it would be nice to do it automatically.

sarangan12 avatar Jun 23 '21 17:06 sarangan12

This applies not only to core packages, but also to any other dependencies.

ramya-rao-a avatar Sep 30 '21 18:09 ramya-rao-a

Older discussion on this topic: #600

ramya-rao-a avatar Sep 30 '21 18:09 ramya-rao-a

I was thinking you might be able to do the following:

  1. Take the list of dependencies as they're currently defined in packageFileGenerator
  2. Fetch https://raw.githubusercontent.com/Azure/azure-sdk-for-js/main/sdk/template/template/package.json and parse it
  3. Take an intersection of the two dependencies / devDependencies sections to end up with packageName -> [version1, version2?] and resolve to the greater of the two versions

Would something like that work? template project is managed by rush and stays in sync so I imagine this will do the right thing like 80% of the time...

maorleger avatar Sep 30 '21 18:09 maorleger