Blocklet Workflows
The blocklet
command is your primary tool for managing the entire lifecycle of an individual blocklet—from creation and local development to packaging and distribution. This section outlines the typical workflow and guides you through each stage.
The Blocklet Lifecycle#
A blocklet typically progresses through four main stages. The following diagram illustrates this common workflow and the commands associated with each step.
Project Setup#
This is the starting point for any new blocklet. The CLI provides two primary commands to bootstrap your project:
blocklet create
: Scaffolds a new blocklet project from various starter templates.blocklet init
: Creates an empty blocklet project with a basicblocklet.yml
file, giving you a blank canvas.
These commands set up the necessary file structure and metadata, preparing your project for development.
Learn more about Project Setup.
Local Development#
Once your project is set up, you'll spend most of your time in the development phase. The blocklet dev
command is central to this stage. It runs your blocklet in a development mode connected to your local Blocklet Server, providing features like live-reloading.
This workflow allows you to build features, test changes, and manage the state of your development blocklet without affecting a production environment.
Dive into the Local Development process.
Packaging & Versioning#
When your blocklet is ready for a release, it needs to be packaged into a distributable format. This stage involves two key commands:
blocklet version
: Bumps the version number in yourblocklet.yml
file, following semantic versioning standards.blocklet bundle
: Compiles your blocklet's assets and dependencies into a single, deployable.blocklet
file.
Properly packaging and versioning your blocklet ensures that it can be reliably deployed and managed.
Find out how to prepare your blocklet in Packaging & Versioning.
Distribution#
The final step is to get your blocklet to its destination. There are two primary methods for distribution:
blocklet deploy
: Deploys a bundled blocklet directly from your local machine to a specified Blocklet Server instance.blocklet upload
: Uploads your bundled blocklet to a blocklet store, making it available for others to discover and install.
You can also use blocklet connect
to configure your CLI to communicate with a specific blocklet store.
Explore your options for Distribution.
Next Steps#
To get started, proceed to the Project Setup guide to create your first blocklet.