Skip to content
Kunkun

Extension Manifest Validator

Kunkun extensions metadata are defined in package.json.

Writing manifest file in json without intellisense is error-prone and comfusing.

For better DX, I provide some tools for manifest file validation and intellisense.

Json Schema

In the package.json of your extension, you can add a $schema field. In VSCode and most modern code editors, this will enable intellisense for the fields in the manifest file. Missing fields and wrong data types will be highlighted.

The schema will run through a validator during loading and publishing. Without a valid manifest file, you will not be able to develop or publish the extension.

package.json
{
"$schema": "https://schema.kunkun.sh",
...
}

If you don’t want to include this in your package.json, you can also configure VSCode workspace setting

.vscode/settings.json
{
"json.schemas": [
{
"fileMatch": ["<path to extension>/package.json"],
"url": "https://schema.kunkun.sh"
}
]
}

Key Fields

  • name (string): The name of the extension.
  • version (string): The version of the extension.
  • files (string[]): The files to be included in the publish package. Only include necessary files. e.g. most of the time ["dist"] is enough.
  • kunkun: Add extension details and commands info here.

Playground

Here are two playgrounds with schema enabled. You can validate your extension manifest or experiment with the intellisense.

Sample Package JSON

Try removing the description field or change kunkun to kk. Error messages will be shown below.