blocklet version
The blocklet version command updates the version of your blocklet in the blocklet.yml file. It follows standard Semantic Versioning (SemVer) rules to increment the version number. This command also automatically updates the specVersion to the latest version supported by the CLI.
This is a crucial step before packaging your blocklet for release, ensuring that each new version is correctly tagged.
Usage#
blocklet version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease] [options]Workflow#
The command executes a series of steps to safely update your blocklet's version.
Arguments#
Argument | Description |
|---|---|
| Optional. Specifies the new version. It can be a valid SemVer string (e.g., |
Options#
Option | Description |
|---|---|
| Automatically adds |
| Forces the update even if it results in downgrading the |
Examples#
Increment the Patch Version#
If your current version is 1.0.0, running the command without arguments will increment the patch number.
# Current version in blocklet.yml: 1.0.0
blocklet version
# This is equivalent to explicitly specifying 'patch'
blocklet version patchOutput:
Blocklet version bumped to 1.0.1Increment the Minor Version and Commit#
To bump the minor version and create a Git commit automatically, use the --git-commit flag.
# Current version: 1.0.1
blocklet version minor --git-commitOutput:
Blocklet version bumped to 1.1.0
# A 'git commit' will also be executedSet a Specific Version#
You can set a precise version number, including pre-release identifiers.
blocklet version 2.0.0-beta.1Output:
Blocklet version bumped to 2.0.0-beta.1Handling specVersion Downgrade#
If the CLI's specVersion is lower than the one in your blocklet.yml, the command will prevent a downgrade by default to ensure compatibility. You will see an error message prompting you to upgrade your CLI.
Error Output:
The new specVersion of blocklet.yml (1.6.0) is smaller than the current specVersion (1.7.0)
Please upgrade the version of the "blocklet" command by executing blocklet server upgradeTo override this safety check, you can use the --force flag.
blocklet version patch --forceAfter versioning your blocklet, the next step is often to package it for distribution. Learn more in the blocklet bundle command reference. For more details on the blocklet.yml manifest file, see the Project Structure guide.