* Add documentation for manifest file and add default manifest template

* Remove comment

* Update id naming pattern
This commit is contained in:
helenkzhang 2023-09-14 11:31:25 -07:00 коммит произвёл GitHub
Родитель ab49926ec5
Коммит 336bca857f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 57 добавлений и 4 удалений

Просмотреть файл

@ -0,0 +1,19 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/microsoft-performance-toolkit-sdk/main/src/PluginsSystem/Tools/Microsoft.Performance.Toolkit.Plugins.Cli/Manifest/PluginManifestSchema.json",
"identity": {
"id": "__PLUGIN_ID__",
"version": "__PLUGIN_VERSION__"
},
"displayName": "__PLUGIN_DISPLAY_NAME__",
"description": "__PLUGIN_DESCRIPTION__",
"owners": [
{
"name": "__PLUGIN_OWNER_NAME__",
"address": "__PLUGIN_OWNER_ADDRESS__",
"emailAddresses": [ "__PLUGIN_OWNER_EMAIL__A__", "__PLUGIN_OWNER_EMAIL__B__" ],
"phoneNumbers": [ "__PLUGIN_OWNER_PHONE__A__", "__PLUGIN_OWNER_PHONE__B__" ]
}
],
"projectUrl": "__PLUGIN_PROJECT_URL__",
"manifestVersion": 1.0
}

Просмотреть файл

@ -25,4 +25,38 @@ The `plugintool` cli can be used to generate plugin metadata files (`metadata.js
- `-m|--manifest <MANIFEST_FILE>`
Specifies the path to the manifest file. If not provided, the tool will look for a `pluginManifest.json` file in the source directory.
- `-w|--overwrite`
Specifies whether to overwrite existing metadata files if they exist. It's only valid if the `-o|--output` option is specified.
Specifies whether to overwrite existing metadata files if they exist. It's only valid if the `-o|--output` option is specified.
### Manifest File
The manifest file is an editable JSON file that allows users to specify the metadata for a plugin. To generate metadata files or package a plugin, a manifest file must be provided. The tool will look for a `pluginManifest.json` file in the source directory by default. The manifest file can also be specified using the `-m|--manifest` option. A template of the manifest file can be found [here](https://raw.githubusercontent.com/microsoft/microsoft-performance-toolkit-sdk/main/devel-template/templates/PluginTemplate/pluginManifest.json).
The manifest file contains the following properties:
#### `identity`
`id` - An identifier for the plugin. Plugin IDs must be unique within the context of a plugin feed. It's recommended to use dots to create a namespace-like structure that reflects the organization and projects the plugin belongs to. e.g. `MyCompany.MyPlugin` or `MyCompany.MyProject.MyPlugin`.
`version` - The version of the plugin in the format of sematic versioning. e.g. `1.0.0` or `1.0.0-beta.1`.
#### `displayName`
A human-readable name for the plugin. e.g. `My Plugin`.
#### `description`
A human-readable description for the plugin. e.g. `This is a plugin for my application.`
#### `owners`
A list of owners for the plugin.
`name` - The name of the owner. e.g. `John Doe`.
`address` - The address of the owner. e.g. `My Company, 123 Main St, New York, NY 10001`.
`emailAddresses` - A list of email addresses for the owner. e.g. `[ "myemail1@hotmail.com", "myemail2@outlook.com" ]`
`phoneNumbers` - A list of phone numbers for the owner. e.g. `[ "123-456-7890", "098-765-4321" ]`
#### `projectUrl`
The URL of the project repository. e.g. `https://github.com/mycompany/myplugin`.
#### `manifestVersion`
The version of the manifest file defined in the schema this manifest file conforms to. e.g. `1.0`.

Просмотреть файл

@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "JSON Schema a plugin manifest",
"title": "Plugin Manifest Schema",
"type": "object",
"required": [
"identity",
@ -24,8 +24,8 @@
},
"version": {
"type": "string",
"pattern": "^(\\d+\\.\\d+\\.\\d+)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?$",
"description": "The version number of the plugin."
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"description": "Semantic version of the plugin."
}
}
},