component
The blocklet component command provides a convenient wrapper to execute commands from the @blocklet/component-studio-cli, allowing you to manage components directly within your Blocklet project's workflow.
Usage#
blocklet component [component-studio-cli-command] [options]Description#
This command acts as a proxy, forwarding all subsequent arguments to the @blocklet/component-studio-cli package, which is executed using npx. It streamlines component management by integrating the Component Studio CLI's functionality into the Blocklet CLI, so you don't need to run separate npx commands.
For example, any command that you would normally run as npx @blocklet/component-studio-cli <command> can be run as blocklet component <command>.
Example#
To create a new component using a specific template from the Component Studio CLI, you can use the following command:
# This command using the wrapper...
blocklet component create my-app --template react
# ...is equivalent to executing the full npx command:
npx -y @blocklet/component-studio-cli create my-app --template reactTroubleshooting#
If the command fails for any reason, the Blocklet CLI will output the underlying error and suggest running the full npx command directly. This can be useful for debugging issues that may originate from the Component Studio CLI itself.
# Example error output
There was a problem executing npx -y @blocklet/component-studio-cli create my-app --template react
You can try running the command directly: npx -y @blocklet/component-studio-cli create my-app --template reactOnce you have created or managed your components, you can add them as dependencies to your blocklet. To learn more, see the documentation for the add and remove commands.