From 659c63e5cb7e7f71918394d5dc2c2629c10dda1b Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Wed, 29 Mar 2017 22:14:56 -0300 Subject: [PATCH] Adds graph functionality for plugins --- client/coral-framework/helpers/importer.js | 12 +++++++++--- client/coral-framework/index.js | 2 ++ plugins/coral-plugin-respect/client/index.js | 1 + test/client/.babelrc | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/client/coral-framework/helpers/importer.js b/client/coral-framework/helpers/importer.js index de031a744..f152757c2 100644 --- a/client/coral-framework/helpers/importer.js +++ b/client/coral-framework/helpers/importer.js @@ -1,3 +1,5 @@ +import asd from 'coral-framework'; +console.log(asd) import {client as clientPlugins} from 'pluginsConfig'; function importer (fill) { @@ -42,7 +44,11 @@ function importer (fill) { } function addProps (plugin) { - plugin.props = getConfig(plugin.name); + + /** + * addProps add properties to the injected plugins + */ + plugin.props = {...getConfig(plugin.name), plugin: 'true'}; return plugin; } @@ -108,8 +114,8 @@ function graphImporter () { return context .keys() .map(key => shapeData(key)) - .reduce((entry, actionsPlugin) => { - const input = context(actionsPlugin.key); + .reduce((entry, graphPlugin) => { + const input = context(graphPlugin.key); const res = Object.keys(input) .map(key => input[key]); return [...entry, ...res]; diff --git a/client/coral-framework/index.js b/client/coral-framework/index.js index 5f923e908..081de80cd 100644 --- a/client/coral-framework/index.js +++ b/client/coral-framework/index.js @@ -4,10 +4,12 @@ import I18n from './modules/i18n/i18n'; import actions from './actions'; import Slot from './components/Slot'; +console.log(actions); export default { pym, Slot, I18n, store, + actions, ...actions }; diff --git a/plugins/coral-plugin-respect/client/index.js b/plugins/coral-plugin-respect/client/index.js index 2ea5751a8..9db812fcc 100644 --- a/plugins/coral-plugin-respect/client/index.js +++ b/plugins/coral-plugin-respect/client/index.js @@ -3,6 +3,7 @@ import styles from './style.css'; export default (props) => (
+ {console.log(props)}
); diff --git a/test/client/.babelrc b/test/client/.babelrc index 9bd819c32..633f93f42 100644 --- a/test/client/.babelrc +++ b/test/client/.babelrc @@ -1,3 +1,3 @@ { - "extends": "../../client/.babelrc" + "extends": "../../.babelrc" }