Second-Generation Managed Packaging Keywords

A keyword is a variable that you can use to specify a package version number.

You can use keywords to automatically increment the value of the package build numbers, ancestor version numbers, set the package dependency to the latest version, or the latest released and promoted version.

Use the KeywordExample
LATEST to specify the latest version of the package dependency when you create a package version.See the example after this table.
NEXT to increment the build number to the next available for the package version. If you don’t use NEXT, and you also forget to update the version number in your sfdx-project.json file, the new package version uses the same number as the previous package version. Although we don’t enforce uniqueness on package version numbers, every package version is assigned a unique subscriber package version ID (starts with 04t).See the example after this table.
RELEASED to specify the latest promoted and released version of the package dependency when you create a package version.See the example after this table.
HIGHEST to automatically set the package ancestor to the highest promoted and released package version number. Use only with ancestor version or ancestor ID.See the example after this table.
NONE in the ancestor version or ancestor ID field. Ancestry defines package upgrade paths. If the package ancestor is set to NONE, an existing customer can’t upgrade to that package version.See the example after this table.

Example using LATEST:

1"dependencies": [
2   {
3      "package": "MyPackageName",
4      "versionNumber": "0.1.0.LATEST"
5   }
6]

Example using NEXT:

1"versionNumber": "1.2.0.NEXT"

Example using RELEASED:

1"dependencies": [
2   {
3    "package": "pkgB",
4    "versionNumber": "2.1.0.RELEASED"
5    }
6]

Example using HIGHEST:

1"packageDirectories": [
2{
3"path": "util",
4"package": "Expense Manager - Util",
5"versionNumber": "4.7.0.NEXT",
6"ancestorVersion": "HIGHEST"
7},

Example using NONE:

1"packageDirectories": [
2{
3"path": "util",
4"package": "Expense Manager - Util",
5"versionNumber": "4.7.0.NEXT",
6"ancestorVersion": "NONE"
7},