как использовать @ grafana / toolkit для создания плагина панели в Grafana 6.4.2 - PullRequest
0 голосов
/ 17 октября 2019

Я пытаюсь построить панель круговой диаграммы после установки @ grafana / toolkit, запустив npm install @grafana/toolkit

После того, как я внес изменения в файл rendering.ts и собрал плагин с помощью команды npm run build Я получаю следующую ошибку:

D:\Workspace\grafana-plugins\piechart-panel-master>npm run build

> piechart-panel@1.3.9 build D:\Workspace\grafana-plugins\piechart-panel-master
> grafana-toolkit plugin:build

√ Cleaning
√ Preparing
√ Prettier check
√ Linting
 PASS  src/piechart_ctrl.test.ts (5.495s)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        32.919s
Ran all test suites with tests matching "".
√ Running tests
- Compiling...  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\module.ts(2,31)
        TS2307: Cannot find module 'grafana/app/plugins/sdk'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(1,34)
        TS2307: Cannot find module 'grafana/app/plugins/sdk'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(2,15)
        TS2307: Cannot find module 'lodash'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(3,17)
        TS2307: Cannot find module 'grafana/app/core/utils/kbn'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(49,21)
        TS2339: Property 'panel' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(50,21)
        TS2339: Property 'panel' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(52,10)
        TS2339: Property 'events' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(53,10)
        TS2339: Property 'events' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(54,10)
        TS2339: Property 'events' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(55,10)
        TS2339: Property 'events' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(56,10)
        TS2339: Property 'events' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(62,10)
        TS2339: Property 'addEditorTab' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(67,10)
        TS2339: Property 'panel' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(68,10)
        TS2551: Property 'render' does not exist on type 'PieChartCtrl'. Did you mean 'onRender'?
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(73,10)
        TS2551: Property 'render' does not exist on type 'PieChartCtrl'. Did you mean 'onRender'?
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(78,10)
        TS2339: Property 'panel' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(79,10)
        TS2551: Property 'render' does not exist on type 'PieChartCtrl'. Did you mean 'onRender'?
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(87,32)
        TS7006: Parameter 'serie' implicitly has an 'any' type.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(87,39)
        TS7006: Parameter 'i' implicitly has an 'any' type.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(90,32)
        TS2339: Property 'panel' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(91,21)
        TS2339: Property 'panel' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(92,38)
        TS2339: Property 'panel' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(100,10)
        TS2551: Property 'render' does not exist on type 'PieChartCtrl'. Did you mean 'onRender'?
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(109,49)
        TS2339: Property 'panel' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(114,25)
        TS2339: Property 'panel' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(115,31)
        TS2339: Property 'panel' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(159,46)
        TS2339: Property 'panel' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(176,10)
        TS2551: Property 'render' does not exist on type 'PieChartCtrl'. Did you mean 'onRender'?
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(181,10)
        TS2551: Property 'render' does not exist on type 'PieChartCtrl'. Did you mean 'onRender'?
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(187,24)
        TS2339: Property 'panel' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(187,67)
        TS2339: Property 'panel' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\piechart_ctrl.ts(188,12)
        TS2339: Property 'panel' does not exist on type 'PieChartCtrl'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\rendering.ts(1,15)
        TS2307: Cannot find module 'lodash'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\rendering.ts(3,15)
        TS2307: Cannot find module 'jquery'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\legend.ts(1,21)
        TS2307: Cannot find module 'angular'.
  [tsl] ERROR in D:\Workspace\grafana-plugins\piechart-panel-master\src\legend.ts(10,15)
        TS2307: Cannot find module 'lodash'.
...