diff --git a/.babelrc b/.babelrc new file mode 100644 index 000000000..63b1c53de --- /dev/null +++ b/.babelrc @@ -0,0 +1,14 @@ +{ + "presets": [ + "es2015" + ], + "plugins": [ + "add-module-exports", + "transform-class-properties", + "transform-decorators-legacy", + "transform-object-assign", + "transform-object-rest-spread", + "transform-async-to-generator", + "transform-react-jsx" + ] +} diff --git a/.nodemon.json b/.nodemon.json index 4c48c707e..7f7fd3d59 100644 --- a/.nodemon.json +++ b/.nodemon.json @@ -1,5 +1,5 @@ { "verbose": true, - "ignore": ["test/*", "client/*", "dist/*"], + "ignore": ["test/*", "client/*", "dist/*", "plugins/*/client"], "ext": "js,json,graphql" } diff --git a/client/coral-embed-stream/src/Embed.js b/client/coral-embed-stream/src/Embed.js index 2edca12c5..791f4ef5f 100644 --- a/client/coral-embed-stream/src/Embed.js +++ b/client/coral-embed-stream/src/Embed.js @@ -16,7 +16,7 @@ import {queryStream} from 'coral-framework/graphql/queries'; import {postComment, postFlag, postLike, postDontAgree, deleteAction, addCommentTag, removeCommentTag} from 'coral-framework/graphql/mutations'; import {editName} from 'coral-framework/actions/user'; import {updateCountCache} from 'coral-framework/actions/asset'; -import {notificationActions, authActions, assetActions, pym} from 'coral-framework'; +import {notificationActions, authActions, assetActions, pym, Slot} from 'coral-framework'; import Stream from './Stream'; import InfoBox from 'coral-plugin-infobox/InfoBox'; @@ -34,7 +34,6 @@ import ConfigureStreamContainer from 'coral-configure/containers/ConfigureStream import Comment from './Comment'; import LoadMore from './LoadMore'; import NewCount from './NewCount'; -import {Slot} from 'coral-framework'; class Embed extends Component { diff --git a/client/coral-framework/components/Slot.js b/client/coral-framework/components/Slot.js index 75a71fee4..850c86835 100644 --- a/client/coral-framework/components/Slot.js +++ b/client/coral-framework/components/Slot.js @@ -1,5 +1,5 @@ import React, {Component} from 'react'; -import { importer as injectPlugins } from 'coral-framework/helpers/importer'; +import {importer as injectPlugins} from 'coral-framework/helpers/importer'; class Slot extends Component { render() { diff --git a/client/coral-framework/helpers/importer.js b/client/coral-framework/helpers/importer.js index 1613dfc73..904673075 100644 --- a/client/coral-framework/helpers/importer.js +++ b/client/coral-framework/helpers/importer.js @@ -96,21 +96,11 @@ function importAll(context) { } function actionsImporter () { - return importAll(require.context('plugins', true, /\.\/(.*)\/client\/actions.js$/)) - - + return importAll(require.context('plugins', true, /\.\/(.*)\/client\/actions.js$/)); } function reducersImporter () { - const context = require.context('plugins', true, /\.\/(.*)\/client\/reducer.js$/); - - return context - .keys() - .map(key => shapeData(key)) - .reduce((entry, reducerPlugin) => { - entry[reducerPlugin.name] = context(reducerPlugin.key); - return entry; - }, {}); + return importAll(require.context('plugins', true, /\.\/(.*)\/client\/reducer.js$/)); } export default { diff --git a/client/coral-framework/index.js b/client/coral-framework/index.js index 4de928168..5f923e908 100644 --- a/client/coral-framework/index.js +++ b/client/coral-framework/index.js @@ -4,7 +4,6 @@ import I18n from './modules/i18n/i18n'; import actions from './actions'; import Slot from './components/Slot'; -console.log(actions) export default { pym, Slot, diff --git a/package.json b/package.json index 6fdf4560a..f5e0652a6 100644 --- a/package.json +++ b/package.json @@ -93,6 +93,7 @@ "devDependencies": { "apollo-client": "^0.8.3", "autoprefixer": "^6.5.2", + "babel-cli": "^6.24.0", "babel-core": "^6.24.0", "babel-eslint": "^7.2.1", "babel-jest": "^19.0.0", @@ -106,6 +107,7 @@ "babel-plugin-transform-react-jsx": "^6.23.0", "babel-polyfill": "^6.23.0", "babel-preset-es2015": "^6.24.0", + "babel-preset-react": "^6.23.0", "babel-preset-stage-0": "^6.16.0", "chai": "^3.5.0", "chai-as-promised": "^6.0.0", diff --git a/plugins/coral-plugin-respect/client/actions.js b/plugins/coral-plugin-respect/client/actions.js index 5259ef664..e3dd724f2 100644 --- a/plugins/coral-plugin-respect/client/actions.js +++ b/plugins/coral-plugin-respect/client/actions.js @@ -1 +1 @@ -export const clickButton = () => ({type: 'BUTTON_CLICKED'}); \ No newline at end of file +export const clickButton = () => ({type: 'BUTTON_CLICKED'}); diff --git a/plugins/coral-plugin-respect/client/reducer.js b/plugins/coral-plugin-respect/client/reducer.js index 3809aaf46..399765f6f 100644 --- a/plugins/coral-plugin-respect/client/reducer.js +++ b/plugins/coral-plugin-respect/client/reducer.js @@ -6,7 +6,7 @@ const initialState = Map({ export default function reducer (state = initialState, action) { switch (action.type) { - default: - return state; + default: + return state; } }