Spin Verman – The Version Manager Plugin

Spin Verman - The Version Manager Plugin


By: Andrew Steurer

We are excited to announce the Spin version manager (verman) plugin! We noticed that some of our engineers spend a lot of time switching between different versions of Spin, so we decided it was time to create a plugin to make this process less tedious.



What is Spin?

Spin is an open-source framework for building WebAssembly applications, which has a ton of amazing features, including portability (a single binary can run on many architectures), and sub-millisecond cold-start times. See the Spin Project Docs for more details.



What is a Plugin?

Spin plugins add new functionality or subcommands to Spin without modifying the Spin codebase. Plugins can be added to the Spin plugins repository and then listed and installed using the spin plugins command. Since plugins have their own versioning system, they can be developed and released independently of Spin, with updates being applied by running spin plugins update && spin plugins upgrade <plugin-name>



How to use the plugin



Install the plugin

spin plugins update
spin plugins install verman
Enter fullscreen mode

Exit fullscreen mode

Once the plugin is installed, you’ll need to prepend the verman current_version directory to your path, allowing the verman plugin to temporarily override your current version of Spin:

# To permanently prepend the "current_version" directory to your path, add this command to your .zshrc/.bashrc file.
export PATH="$HOME/.spin_verman/versions/current_version:$PATH"
Enter fullscreen mode

Exit fullscreen mode

Once the path is prepended, you can try the below commands:



Download a specific version of Spin

Specify the desired version:

# You can download multiple versions at once
spin verman get canary v2.5.0 2.7.0
Enter fullscreen mode

Exit fullscreen mode

Get the latest stable version:

spin verman get latest
Enter fullscreen mode

Exit fullscreen mode



Set a different version of Spin

Set a specific version:

# Adding the v prefix to the version is optional
spin verman set v2.5.0
Enter fullscreen mode

Exit fullscreen mode

Set the latest version:

spin verman set latest
Enter fullscreen mode

Exit fullscreen mode



Update a version of Spin in the ~/.spin_verman directory

# "canary" is currently the only subcommand supported by "update"
spin verman update canary
Enter fullscreen mode

Exit fullscreen mode



List the versions of Spin that are downloaded via the verman plugin

spin verman list
Enter fullscreen mode

Exit fullscreen mode



Remove a version of Spin downloaded via the verman plugin

Remove a single version:

# Adding the v prefix to the version is optional
spin verman remove v2.5.0
Enter fullscreen mode

Exit fullscreen mode

Remove all versions:

spin verman remove all
Enter fullscreen mode

Exit fullscreen mode

Remove the alternate Spin version, reverting back to the root version of Spin, but preserving all other versions of Spin downloaded locally:

spin verman remove current
Enter fullscreen mode

Exit fullscreen mode

Let us know what you think about the plugin on our Discord.

If you encounter bugs, would like to see new features, or would like to examine the source code, feel free to visit the repository on GitHub.



Source link
lol

By stp2y

Leave a Reply

Your email address will not be published. Required fields are marked *

No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.