KeymanWeb has long had `keyman.build` and `keyman.version`. Neither of these properties expose the full version string, and consumers are forced to manipulate them to get a partial version string. This change deprecates both these properties, and introduces a new `keyman.versionInfo` property, which returns an object with all the version information, most importantly `full`. Update documentation and add a unit test for this, following the unit test pattern established throughout Keyman of a unit test filename matching the implementation class. The `KeymanEngineBase` class is a little difficult to instantiate so this unit test module currently has a minimal instantiation which provides enough to fulfill the one included test. Test-bot: skip
1.7 KiB
| title |
|---|
| versionInfo |
Summary
Returns an object describing the current KeymanWeb version.
Syntax
keyman.versionInfo
Type
object
Access
Read only
Return Value
An object with the following properties:
-
full: string:"major.minor.patch[-tier][-environment]".tierwill be included for alpha and beta.environmentwill be included for local or test builds, and for test builds may include an additional test context such as a pull request number. -
major: number: major component of the version string -
minor: number: minor component of the version string -
patch: number: patch component of the version string -
version: string:"major.minor.patch"string -
tier: string: The tier,"stable","beta", or"alpha" -
environment: string: One of"stable","beta","alpha","local", or"test". For release builds, the same astier; for development builds,"local", and for test builds"test". Test context is only included in thefullproperty.
Example return value
{
full: "18.0.249-alpha-local",
major: 18,
minor: 0,
patch: 249,
version: "18.0.249",
tier: "alpha",
environment: "local"
}
Description
This property should be used instead of the deprecated [keyman.build] or
[keyman.version] properties. In most cases, you should use the full property
as the version to display to users. The major property can be used for version
gating.
History
- 19.0: introduced
versionInfoproperty, deprecatedbuildandversion.