如何向 API Management 开发人员门户提供小组件How to contribute widgets to the API Management developer portal

如果要向 API Management 开发人员门户 GitHub 存储库提供小组件,请执行以下三步流程:If you'd like to contribute a widget to the API Management developer portal GitHub repository, follow this three-step process:

  1. 创建存储库分支。Fork the repository.

  2. 实现小组件。Implement the widget.

  3. 打开拉取请求,将小组件包含在官方存储库中。Open a pull request to include your widget in the official repository.

你的小组件将继承存储库的许可证。Your widget will inherit the repository's license. 它将在自托管版本门户的选择加入安装中提供。It will be available for opt-in installation in the self-hosted version of the portal. 开发人员门户团队还可以决定将其包含在门户的托管版本中。The developer portal team may decide to also include it in the managed version of the portal.

有关如何开发自己的小组件的示例,请参阅小组件实现教程。Refer to the widget implementation tutorial for an example of how to develop your own widget.

贡献准则Contribution guidelines

本指南旨在确保客户及其门户访问者的安全和隐私。This guidance is intended to ensure the safety and privacy of our customers and the visitors to their portals. 请遵循以下准则以确保你的贡献被接受:Follow these guidelines to ensure your contribution is accepted:

  1. 将小组件置于 community/widgets/<your-widget-name> 文件夹中。Place your widget in the community/widgets/<your-widget-name> folder.

  2. 小组件的名称必须为小写和字母数字,并用短划线分隔字词。Your widget's name must be lowercase and alphanumeric with dashes separating the words. 例如,my-new-widgetFor example, my-new-widget.

  3. 文件夹必须包含小组件在已发布的门户中的屏幕截图。The folder must contain a screenshot of your widget in a published portal.

  4. 文件夹必须包含 readme.md 文件,该文件应遵循 /scaffolds/widget/readme.md 文件中的模板。The folder must contain a readme.md file, which follows the template from the /scaffolds/widget/readme.md file.

  5. 文件夹可以包含一个 npm_dependencies 文件,其中包含用于安装或管理小组件依赖项的 npm 命令。The folder can contain an npm_dependencies file with npm commands to install or manage the widget's dependencies.

    显式指定每个依赖项的版本。Explicitly specify the version of every dependency. 例如:For example:

    npm install azure-storage@2.10.3 axios@0.19.1
    

    小组件需要的依赖项应该最少。Your widget should require minimal dependencies. 审阅者将仔细检查每个依赖项。Every dependency will be carefully inspected by the reviewers. 特别是,小组件的核心逻辑在小组件文件夹中应该是开放源代码。In particular, the core logic of your widget should be open-sourced in your widget's folder. 请勿将其包装在 npm 包中。Don't wrap it in an npm package.

  6. 小组件的文件夹之外的任何文件的更改都不允许作为小组件贡献的一部分。Changes to any files outside your widget's folder aren't allowed as part of a widget contribution. 这包括但不限于 /package.json 文件。That includes, but isn't limited to, the /package.json file.

  7. 不允许插入跟踪脚本或将客户编写的数据发送到自定义服务。Injecting tracking scripts or sending customer-authored data to custom services isn't allowed.

    备注

    你只能通过 Logger 接口收集客户编写的数据。You can only collect customer-authored data through the Logger interface.

后续步骤Next steps