Skip to content

Commit

Permalink
[pluginDiscovery] rename collectExportSpecs
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Nov 2, 2017
1 parent 15f0a30 commit e1be276
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/plugin_discovery/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { findPluginSpecs } from './find_plugin_specs';
export { reduceExportSpecs } from './plugin_exports';
export { collectExportSpecs } from './plugin_exports';
export { PluginPack } from './plugin_pack';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import expect from 'expect.js';

import { PluginPack } from '../../plugin_pack';
import { reduceExportSpecs } from '../reduce_export_specs';
import { collectExportSpecs } from '../collect_export_specs';

const PLUGIN = new PluginPack({
path: __dirname,
Expand Down Expand Up @@ -46,9 +46,9 @@ const REDUCERS = {

const PLUGIN_SPECS = PLUGIN.getPluginSpecs();

describe('reduceExportSpecs', () => {
describe('collectExportSpecs', () => {
it('combines ui exports from a list of plugin definitions', () => {
const exports = reduceExportSpecs(PLUGIN_SPECS, REDUCERS);
const exports = collectExportSpecs(PLUGIN_SPECS, REDUCERS);
expect(exports).to.eql({
names: [
'foo:export1',
Expand All @@ -59,7 +59,7 @@ describe('reduceExportSpecs', () => {
});

it('starts with the defaults', () => {
const exports = reduceExportSpecs(PLUGIN_SPECS, REDUCERS, {
const exports = collectExportSpecs(PLUGIN_SPECS, REDUCERS, {
names: [
'default'
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @param {Object<exportType,exports} [defaults={}]
* @return {Object<exportType,exports>}
*/
export function reduceExportSpecs(pluginSpecs, reducers, defaults = {}) {
export function collectExportSpecs(pluginSpecs, reducers, defaults = {}) {
return pluginSpecs.reduce((acc, pluginSpec) => {
const specsByType = pluginSpec.getExportSpecs() || {};
const types = Object.keys(specsByType);
Expand Down
2 changes: 1 addition & 1 deletion src/plugin_discovery/plugin_exports/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { reduceExportSpecs } from './reduce_export_specs';
export { collectExportSpecs } from './collect_export_specs';
4 changes: 2 additions & 2 deletions src/ui/ui_exports/collect_ui_exports.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { UI_EXPORT_DEFAULTS } from './ui_export_defaults';
import * as uiExportTypeReducers from './ui_export_types';
import { reduceExportSpecs } from '../../plugin_discovery';
import { collectExportSpecs } from '../../plugin_discovery';

export function collectUiExports(pluginSpecs) {
return reduceExportSpecs(
return collectExportSpecs(
pluginSpecs,
uiExportTypeReducers,
UI_EXPORT_DEFAULTS
Expand Down

0 comments on commit e1be276

Please sign in to comment.