Get the version of installed packages


#1

How to get the version (of package.json) of installed packages/repositories? like (c3base, foundation…)


#2

Some of these info can found with Cluster.hosts() in the result check the values in field serverInfo.


#3

Tag.get(c3Context().tag).infos gives info about the root package, and Cluster.hosts() about the server.
I’m looking after getting info on the other packages of base repository (foundation, uiframwork…) and also the version of the base repository.


#4

I don’t think you can have a situation where server is a.b.c and your base is x.y.z!
also with c3Grid(Tag.get(c3Context().tag)).packages you can have the full list of packages the app depends on.


#5

MetadataRepository.repositoryVersion(“base”); OR
MetadataStore.tag().repository(“server”).version;

package version is same as repository version that package belongs.
base and server version could be different.

To get repository of a package ex:
MetadataStore.tag().package(“dataManagement”).repository;

look up TagMetadataStore for more info and apis


#6

I realize this doesn’t answer the main question, but it’s worth noting that there’s also SystemInformation.about(), which I learned about the other day. I’ll update my Tip of the Day as well.


#7

@ryan.samp I found that most of the time the appsVersion is null in the SystemInformation.about().
Any idea how this type is populated?


#8

@bachr Looks like it’s populated with Tag.get(c3Context().tag).infos.packageVersion


#9

The most reliable api is MetadataStore.tag().rootRepository().semanticVersion