Used to check for browser translation.
用于检测浏览器翻译。
ブラウザの翻訳を検出する
Blocklet Specification (blocklet.yml)

Distribution & Links


This section details the fields in blocklet.yml that specify how your blocklet is packaged for distribution, where its source code is located, and how users can find related information, documentation, and support channels. These properties are crucial for publishing to a blocklet registry and presenting your blocklet to the community.

Distribution Package (dist)#

The dist object contains information about the published tarball of the blocklet. These fields are typically generated and populated automatically by the blocklet publish command and should not be manually edited.

Field

Type

Description

tarball

string

The required URL pointing to the compressed blocklet package (.tgz).

integrity

string

A subresource integrity (SRI) hash of the package. This is used to verify that the downloaded package has not been tampered with.

size

number

(Optional) The size of the tarball in bytes.

Example:

dist:
tarball: https://registry.arcblock.io/my-blocklet/-/my-blocklet-1.2.0.tgz
integrity: sha512-AbcDeFgHiJkLmNoPqRsTuVwXyZ...==
size: 2048576

Source Code Repository#

The repository field specifies the location of the blocklet's source code. This helps users and contributors find the source, report issues, and contribute improvements.

You can specify the repository in two ways:

  1. Simple String: A direct URL to the repository.
  2. Object: A detailed object specifying the type, URL, and an optional subdirectory.

The gitHash field can be used to pinpoint the exact commit the blocklet was built from, which is useful for debugging and ensuring traceability. It is often injected during the CI/CD process.

Field

Type

Description

repository

string or object

The location of the source code.

repository.type

string

The version control system type (e.g., "git", "svn").

repository.url

string

The URL of the repository.

repository.directory

string

(Optional) The path to the blocklet within a monorepo.

gitHash

string

(Optional) The git commit hash of the build.

Example (Simple):

repository: https://github.com/blocklet/my-awesome-blocklet.git

Example (Detailed Object):

repository:
type: git
url: https://github.com/my-org/monorepo.git
directory: packages/my-awesome-blocklet
gitHash: "fdb29c87a389f4648792a47206b97654a321dead"

These fields provide users with direct links to important resources related to your blocklet.

Field

Type

Description

homepage

string

The official homepage for the blocklet.

documentation

string

A link to the blocklet's primary documentation.

community

string

A URL to a community forum, Discord server, or other discussion platform.

support

string

A URL or an email address for user support.

license

string

The license under which the blocklet is distributed (e.g., "MIT", "Apache-2.0").

Example:

homepage: https://my-blocklet.io
documentation: https://docs.my-blocklet.io
community: https://github.com/blocklet/my-awesome-blocklet/discussions
support: support@my-blocklet.io
license: "MIT"

Registry & Store Metadata#

These fields are primarily used for display purposes in blocklet registries and marketplaces. They help showcase your blocklet's features and track its publication history.

Field

Type

Description

screenshots

string[]

An array of URLs to images showcasing the blocklet's UI or features. Defaults to an empty array.

videos

string[]

An array of up to 3 URLs to promotional or tutorial videos. Must be valid YouTube or Vimeo links.

logoUrl

string

A publicly accessible URL for the blocklet's logo. This is often populated by the registry during publication.

lastPublishedAt

string

An ISO 8601 date string indicating when the version was last published. This is set by the registry.

Example:

screenshots:
- https://cdn.my-blocklet.io/screenshot-1.png
- https://cdn.my-blocklet.io/screenshot-2.png
videos:
- https://www.youtube.com/watch?v=dQw4w9WgXcQ
logoUrl: https://cdn.my-blocklet.io/logo-public.png


After defining your blocklet's distribution and informational links, you need to specify how it runs. Proceed to the Execution & Environment section to learn about configuring the engine, scripts, and environment variables.