Grafana / 创建插件
轻松创建 Grafana 插件 .
毒性
链接
@grafana/create-plugin 用于Linux(WSL)的macOS,Linux和Windows子系统的工作.
如果有什么不起作用,请 提交问题。 。 。 .
如果你有问题或需要帮助,请问 GitHub 讨论。 。 。 .
创建新插件
快速概览
在要存储您的插件的文件夹中运行命令 。 新插件将在您运行此命令的文件夹的子目录中被脚手架 .
创建插件可以与国家预防机制、PNPM或Yarn 1一起使用。 插件将被脚手架以使用您喜欢的软件包管理器 。 用您选择的软件包管理器运行命令 :
npx
npx @grafana/create-plugin@latest
npm
npm init @grafana/plugin
pnpm
pnpm dlx @grafana/create-plugin@latest
yarn (树莓)
yarn dlx @grafana/create-plugin@latest
yarn (1.x) (中文(简体) )
yarn create @grafana/plugin
迁移您已有的插件
警告:我们 不支持 写入的插件 angular
如果您有先前使用此程序创建的现有插件 @grafana/toolkit 您可以使用
遵循命令将其迁移到新建工具 :
# Run this command from the root of your plugin
cd ./my-plugin
npx @grafana/create-plugin@latest migrate
更多信息见 这里
更新您的插件构建配置
以防您的插件被使用 @grafana/toolkit 在确保首先使用 npx @grafana/create-plugin migrate。 。 。 .
随着Grafana新版本的出世,我们不断更新我们的插件构建工具,以便保持相容性,使其更能发挥作用.
为了接收这些修改,并确保您的插件与最新的 Grafana 版本兼容, 您可以使用 update 命令,
自动更新您的构建配置 :
# Run this command from the root of your plugin
cd ./my-plugin
npx @grafana/create-plugin@latest update
更多信息见 这里
自定义或扩展基本配置
您可以阅读更多关于定制或扩展我们的基本配置 文档。 。 。 .
添加到您已有的插件中
您可以通过在您现有的插件中包含规定来精简插件审查过程, 使审查人员能够更有效地测试您的插件 .
# Run this command from the root of your plugin
cd ./my-plugin
npx @grafana/create-plugin@latest provisioning
更多信息见我们 文档。 。 。 .
捐款
我们总是感激捐款! 见 捐款额 更多信息.