Manage Version
The blocklet version
command simplifies the process of updating your blocklet's version number, a critical step before packaging and distributing your work. It modifies the version
field in your blocklet.yml
file according to semantic versioning (semver) rules.
Running this command also updates the specVersion
in your blocklet.yml
to the latest version supported by your CLI, ensuring compatibility.
Usage#
blocklet version [newVersion] [options]
Arguments#
Argument | Description |
---|---|
| Optional. Specifies the version increment. It can be a specific version string (e.g., |
Options#
Option | Description |
---|---|
| Automatically adds |
| Allows the command to proceed even if it results in downgrading the |
Examples#
Bumping a Patch Version#
This is the most common use case. If your current version is 1.2.2
, this command will update it to 1.2.3
.
# Bumps version from 1.2.2 to 1.2.3
blocklet version
# Or explicitly
blocklet version patch
Console Output:
✔ Blocklet version bumped to 1.2.3
Bumping a Minor Version#
To release new features in a backward-compatible way, use the minor
keyword.
# Bumps version from 1.2.3 to 1.3.0
blocklet version minor
Setting a Specific Version#
You can also set the version to a specific number directly.
# Sets the version to 2.0.0 regardless of the current version
blocklet version 2.0.0
Bumping the Version and Committing to Git#
For a streamlined workflow, you can bump the version and commit the change in a single command.
blocklet version patch --git-commit
This command will update blocklet.yml
and then execute the equivalent of:
git add blocklet.yml
git commit -nm "blocklet version x.y.z"
After updating your blocklet's version, the next logical step is to package it. Proceed to the Bundle Blocklet guide to learn how to create a deployable asset from your project.