Get the version of installed packages


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


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


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.


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.


MetadataRepository.repositoryVersion(“base”); OR

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

To get repository of a package ex:

look up TagMetadataStore for more info and apis


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.


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


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


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