forked from jenkinsci/blueocean-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
39 lines (27 loc) · 1.54 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Provide an ExtensionStore & ExtensionRenderer react component
const ExtensionStore = require('./dist/ExtensionStore.js').default;
exports.store = new ExtensionStore();
exports.Renderer = require('./dist/ExtensionRenderer.js').default;
//in lieu of DI
const ResourceLoadTracker = require('./dist/ResourceLoadTracker.js').default;
const resourceLoadTracker = new ResourceLoadTracker();
exports.store.resourceLoadTracker = resourceLoadTracker;
//Put these in statics so we can mock them for testing. Ideally they would come from React scope.
exports.Renderer.extensionStore = exports.store;
exports.Renderer.resourceLoadTracker = resourceLoadTracker;
const ClassMetadataStore = require('./dist/ClassMetadataStore.js').default;
exports.classMetadataStore = new ClassMetadataStore();
exports.SandboxedComponent = require('./dist/SandboxedComponent.js').SandboxedComponent;
exports.ErrorUtils = require('./dist/ErrorUtils.js').default;
exports.Utils = require('./dist/ExtensionUtils.js').default;
exports.dataType = function dataType(dataType) { return exports.classMetadataStore.dataType(dataType); };
exports.untyped = function untyped() { return exports.classMetadataStore.untyped(); };
exports.isType = require('./dist/ComponentTypeFilter.js').isType;
exports.componentType = require('./dist/ComponentTypeFilter.js').componentType;
exports.init = function init(args) {
exports.classMetadataStore.init(args.classMetadataProvider);
exports.store.init({
extensionData: args.extensionData,
classMetadataStore: exports.classMetadataStore,
});
};