feat: use grafana-toolkit to build a plugin

- fix linter warnings
- use yarn: remove Gruntfile.js and package-lock.json

++
This commit is contained in:
Ivan Mikheykin
2021-02-16 17:43:48 +03:00
parent 669033b100
commit e987dee850
159 changed files with 14690 additions and 16778 deletions
-38
View File
@@ -1,38 +0,0 @@
"use strict";
System.register([], function (_export, _context) {
"use strict";
// Old Grafana releases use strings as event ids and
// new event ids in form of object {name: "event-id"} are not
// supported properly: first defined listener will receive
// all emitted events despite of the value in 'name' field.
//
// This method detects this behaviour and return true
// only for new Grafana versions.
function hasAppEventCompatibleEmitter(emitter) {
var receiveEvents = 0;
var eventId = {
name: "non-existed-event-id"
};
var eventId2 = {
name: "non-existed-event-id-2"
};
emitter.on(eventId, function () {
receiveEvents++;
});
emitter.emit(eventId);
emitter.emit(eventId2);
emitter.removeAllListeners(eventId); // New Grafana versions should receive one event.
return receiveEvents == 1;
}
_export("hasAppEventCompatibleEmitter", hasAppEventCompatibleEmitter);
return {
setters: [],
execute: function () {}
};
});
//# sourceMappingURL=funcs.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/libs/polygrafill/funcs.ts"],"names":["hasAppEventCompatibleEmitter","emitter","receiveEvents","eventId","name","eventId2","on","emit","removeAllListeners"],"mappings":";;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,WAASA,4BAAT,CAAsCC,OAAtC,EAAgE;AACnE,QAAIC,aAAa,GAAG,CAApB;AACA,QAAIC,OAAY,GAAG;AAACC,MAAAA,IAAI,EAAE;AAAP,KAAnB;AACA,QAAIC,QAAa,GAAG;AAACD,MAAAA,IAAI,EAAE;AAAP,KAApB;AACAH,IAAAA,OAAO,CAACK,EAAR,CAAWH,OAAX,EAAoB,YAAU;AAC1BD,MAAAA,aAAa;AAChB,KAFD;AAGAD,IAAAA,OAAO,CAACM,IAAR,CAAaJ,OAAb;AACAF,IAAAA,OAAO,CAACM,IAAR,CAAaF,QAAb;AACAJ,IAAAA,OAAO,CAACO,kBAAR,CAA2BL,OAA3B,EATmE,CAWnE;;AACA,WAAOD,aAAa,IAAI,CAAxB;AACH;;0CAbeF,4B","sourcesContent":["import { Emitter } from 'app/core/utils/emitter';\n\n// Old Grafana releases use strings as event ids and\n// new event ids in form of object {name: \"event-id\"} are not\n// supported properly: first defined listener will receive\n// all emitted events despite of the value in 'name' field.\n//\n// This method detects this behaviour and return true\n// only for new Grafana versions.\nexport function hasAppEventCompatibleEmitter(emitter: Emitter):boolean {\n let receiveEvents = 0;\n let eventId: any = {name: \"non-existed-event-id\"};\n let eventId2: any = {name: \"non-existed-event-id-2\"};\n emitter.on(eventId, function(){\n receiveEvents++;\n });\n emitter.emit(eventId);\n emitter.emit(eventId2);\n emitter.removeAllListeners(eventId);\n\n // New Grafana versions should receive one event.\n return receiveEvents == 1;\n}\n"],"file":"funcs.js"}
-16
View File
@@ -1,16 +0,0 @@
"use strict";
System.register(["./funcs"], function (_export, _context) {
"use strict";
var Polygrafill;
return {
setters: [function (_funcs) {
Polygrafill = _funcs;
}],
execute: function () {
_export("Polygrafill", Polygrafill);
}
};
});
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/libs/polygrafill/index.ts"],"names":["Polygrafill"],"mappings":";;;;;;;;AAAYA,MAAAA,W;;;6BACHA,W","sourcesContent":["import * as Polygrafill from './funcs';\nexport { Polygrafill };"],"file":"index.js"}