Used to check for browser translation.
用于检测浏览器翻译。
ブラウザの翻訳を検出する
Command Reference

blocklet meta


The blocklet meta command is a utility for inspecting the configuration of a blocklet. It reads the blocklet.yml and package.json files from the current directory, merges them, and prints the resulting parsed metadata object to the console.

This command is useful for debugging and verifying that your blocklet's configuration is being parsed correctly before bundling or publishing. For more details on the metadata structure and the blocklet.yml file, see the Project Structure documentation.

Usage#

To use the command, navigate to your blocklet's root directory and run:

blocklet meta

Arguments & Options#

This command does not accept any arguments or options. It operates on the blocklet project in the current working directory.

Process Flow#

The command follows a straightforward process to read and display the metadata:

@blocklet/metaFilesystemBlocklet CLIUser@blocklet/metaFilesystemBlocklet CLIUserblocklet metaRead blocklet.ymlReturn file contentRead package.jsonReturn file contentParse metadata from filesReturn merged metadata objectPrint formatted metadata

Example#

Let's say your blocklet project has the following configuration files.

blocklet.yml:

name: my-blocklet
version: 1.0.0
description: A sample blocklet project.
main: blocklet.js
author: user@example.com
interfaces:
- type: web
name: publicUrl
path: /
protocol: http
port: BLOCKLET_PORT

package.json:

{
"name": "my-blocklet",
"version": "1.0.0",
"description": "A sample blocklet project.",
"author": "user@example.com",
"scripts": {
"dev": "blocklet dev"
},
"dependencies": {
"express": "^4.17.1"
}
}

When you run the blocklet meta command in this directory, the CLI will read both files, parse them, and output a consolidated JSON object.

Command#

blocklet meta

Example Response#

{
"name": "my-blocklet",
"version": "1.0.0",
"description": "A sample blocklet project.",
"author": "user@example.com",
"main": "blocklet.js",
"files": [],
"interfaces": [
{
"type": "web",
"name": "publicUrl",
"path": "/",
"protocol": "http",
"port": "BLOCKLET_PORT"
}
],
"scripts": {
"dev": "blocklet dev"
},
"dependencies": {
"express": "^4.17.1"
}
}

This output represents the complete metadata that Blocklet Server will use to run your blocklet.


After verifying your metadata with blocklet meta, a logical next step is to prepare your blocklet for distribution using the blocklet bundle command or to modify its version with blocklet version.