transpiled

This commit is contained in:
bill bittner 2018-05-23 01:18:50 -07:00
parent 0b69ad6e3d
commit 14022d78ca
10 changed files with 43 additions and 70 deletions

View file

@ -1,26 +0,0 @@
"use strict";
var _app = _interopRequireDefault(require("./app"));
var _reducers = _interopRequireDefault(require("./reducers"));
var _sagas = _interopRequireDefault(require("./sagas"));
var _actions = _interopRequireDefault(require("./actions"));
var _GAListener = _interopRequireDefault(require("./components/GAListener"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// app, reducers, sagas, actions
// can it be a function and pass in the config like this?,
// or should all the configs just come from the store (assuming the initial config can be used to config the store)?
module.exports = {
App: _app.default,
Reducers: _reducers.default,
Sagas: _sagas.default,
// includes all the sagas
Actions: _actions.default,
// includes all the actions
GAListener: _GAListener.default
};

View file

@ -70,16 +70,13 @@ function (_React$Component) {
}, "1,428 commits"), ", and ", _react.default.createElement("a", {
href: 'https://github.com/lbryio/spee.ch/graphs/contributors',
target: '_blank'
}, "18 contributors"), " later (as of the time of this writing) -- we\u2019ve been through a lot of changes. We changed the URL scheme, switched out the PHP for Javascript (sorry Jeremy!), added more HTML pages, removed those HTML pages, added Handlebars, removed most of Handlebars, added React, and... you get the picture."), _react.default.createElement("p", null, "It\u2019s been a lot of work, and through all of these changes, we have been guided by our original vision: develop a free web app that allows users to share images and video using a blockchain."), _react.default.createElement("p", null, "However, we ask ourselves constantly: what else can we be doing? What can we be doing differently? What features can we be doing better? And it is those kinds of questions that lead us to this post."), _react.default.createElement("h2", null, "A New Initiative"), _react.default.createElement("p", null, "As Spee.ch developed, we were lucky to find an amazing community spring up around the project that contributed bug reports, bug fixes, feature requests, pull requests, etc., but ultimately we are limited by the hours we have in the day, and while some requests get prioritized, others get shelved. "), _react.default.createElement("p", null, "So we started wondering: What if instead of having the community help us build our platform, we started helping them build theirs? We started mulling this over, and the more we thought about it the more we liked it. And thus, Spee.ch Multisite was born."), _react.default.createElement("h2", null, "Spee.ch Multisite"), _react.default.createElement("p", null, "The vision for Spee.ch Multisite is to maintain a foundational codebase that will support a greater variety of content-sharing web apps built on LBRY, allowing these apps to publish and retrieve content from the network via the blockchain."), _react.default.createElement("h3", null, "Run Your Own Spee.ch!"), _react.default.createElement("p", null, "Ok, here\u2019s the tl:dr: the purpose of the Spee.ch Multisite initiative is to enable you to run your own version of Spee.ch."), _react.default.createElement("p", null, "Spee.ch Multisite will provide a helpful set of basic code to get you going, but we purposefully want to give you control and provide a sandbox in which you can develop the look, content, and features for your site. The shared code base will be developed to support you in that quest. "), _react.default.createElement("p", null, "So if you don\u2019t want your site called or looking anything like Spee.ch, we encourage that! Don\u2019t hesitate to make it your own!"), _react.default.createElement("h3", null, "For the Community by the Community"), _react.default.createElement("p", null, "Initially, sites built on Spee.ch Multisite will look a lot like Spee.ch, but you will be able to add custom pages, update the look of components, and limit the content on your spee.ch site as you see fit."), _react.default.createElement("p", null, "Over time, it is our hope that the project will grow to incorporate many more components and features developed by us and the community to support a wide variety of functionalities beyond what the current spee.ch site is capable of."), _react.default.createElement("h3", null, "A Common Codebase"), _react.default.createElement("p", null, "If you have been following the project, you may have already noticed that the original github repository has grown into three: ", _react.default.createElement("a", {
}, "18 contributors"), " later (as of the time of this writing) -- we\u2019ve been through a lot of changes. We changed the URL scheme, switched out the PHP for Javascript (sorry Jeremy!), added more HTML pages, removed those HTML pages, added Handlebars, removed most of Handlebars, added React, and... you get the picture."), _react.default.createElement("p", null, "It\u2019s been a lot of work, and through all of these changes, we have been guided by our original vision: develop a free web app that allows users to share images and video using a blockchain."), _react.default.createElement("p", null, "However, we ask ourselves constantly: what else can we be doing? What can we be doing differently? What features can we be doing better? And it is those kinds of questions that lead us to this post."), _react.default.createElement("h2", null, "A New Initiative"), _react.default.createElement("p", null, "As Spee.ch developed, we were lucky to find an amazing community spring up around the project that contributed bug reports, bug fixes, feature requests, pull requests, etc., but ultimately we are limited by the hours we have in the day, and while some requests get prioritized, others get shelved. "), _react.default.createElement("p", null, "So we started wondering: What if instead of having the community help us build our platform, we started helping them build theirs? We started mulling this over, and the more we thought about it the more we liked it. And thus, Spee.ch Multisite was born."), _react.default.createElement("h2", null, "Spee.ch Multisite"), _react.default.createElement("p", null, "The vision for Spee.ch Multisite is to maintain a foundational codebase that will support a greater variety of content-sharing web apps built on LBRY, allowing these apps to publish and retrieve content from the network via the blockchain."), _react.default.createElement("h3", null, "Run Your Own Spee.ch!"), _react.default.createElement("p", null, "Ok, here\u2019s the tl:dr: the purpose of the Spee.ch Multisite initiative is to enable you to run your own version of Spee.ch."), _react.default.createElement("p", null, "Spee.ch Multisite will provide a helpful set of basic code to get you going, but we purposefully want to give you control and provide a sandbox in which you can develop the look, content, and features for your site. The shared code base will be developed to support you in that quest. "), _react.default.createElement("p", null, "So if you don\u2019t want your site called or looking anything like Spee.ch, we encourage that! Don\u2019t hesitate to make it your own!"), _react.default.createElement("h3", null, "For the Community by the Community"), _react.default.createElement("p", null, "Initially, sites built on Spee.ch Multisite will look a lot like Spee.ch, but you will be able to add custom pages, update the look of components, and limit the content on your spee.ch site as you see fit."), _react.default.createElement("p", null, "Over time, it is our hope that the project will grow to incorporate many more components and features developed by us and the community to support a wide variety of functionalities beyond what the current spee.ch site is capable of."), _react.default.createElement("h3", null, "A Common Codebase"), _react.default.createElement("p", null, "If you have been following the project, you may have already noticed that the original github repository has grown into two: ", _react.default.createElement("a", {
href: 'https://github.com/lbryio/www.spee.ch',
target: '_blank'
}, "www.spee.ch"), ", ", _react.default.createElement("a", {
}, "www.spee.ch"), " and ", _react.default.createElement("a", {
href: 'https://github.com/lbryio/spee.ch',
target: '_blank'
}, "spee.ch"), ", and ", _react.default.createElement("a", {
href: 'https://github.com/lbryio/spee.ch-components',
target: '_blank'
}, "spee.ch-components"), ". I will save the specifics for a future tech-focused blog post in the coming weeks, but the reason for these changes is to modularise the code so that is it easier for anyone who wants to run their own version of Spee.ch to do so, and to be able to customize their Spee.ch to their liking."), _react.default.createElement("h3", null, "What About the Flagship Spee.ch Site?"), _react.default.createElement("p", null, "Don\u2019t worry! If you like using ", _react.default.createElement("a", {
}, "spee.ch"), ". I will save the specifics for a future tech-focused blog post in the coming weeks, but the reason for these changes is to modularise the code so that is it easier for anyone who wants to run their own version of Spee.ch to do so, and to be able to customize their Spee.ch to their liking."), _react.default.createElement("h3", null, "What About the Flagship Spee.ch Site?"), _react.default.createElement("p", null, "Don\u2019t worry! If you like using ", _react.default.createElement("a", {
href: 'https://spee.ch',
target: '_blank'
}, "Spee.ch"), " and have no intention of running your own site, we will still be here running it for you! We are dedicated to pushing it forward and using it as patient zero for all additions to the Spee.ch Multisite codebase."), _react.default.createElement("h2", null, "Join Us"), _react.default.createElement("p", null, "Friday, May 18, we will be hosting a live demo showcasing the alpha version of Spee.ch Multisite. It\u2019s still quite young, but that\u2019s the point: we want to realize this vision together."), _react.default.createElement("p", null, _react.default.createElement("b", null, _react.default.createElement("a", {

View file

@ -1,16 +0,0 @@
// app, reducers, sagas, actions
import App from './app';
import Reducers from './reducers';
import Sagas from './sagas';
import Actions from './actions';
import GAListener from './components/GAListener';
// can it be a function and pass in the config like this?,
// or should all the configs just come from the store (assuming the initial config can be used to config the store)?
module.exports = {
App,
Reducers,
Sagas, // includes all the sagas
Actions, // includes all the actions
GAListener,
};

View file

@ -34,7 +34,7 @@ class MultisitePage extends React.Component {
<p>Initially, sites built on Spee.ch Multisite will look a lot like Spee.ch, but you will be able to add custom pages, update the look of components, and limit the content on your spee.ch site as you see fit.</p>
<p>Over time, it is our hope that the project will grow to incorporate many more components and features developed by us and the community to support a wide variety of functionalities beyond what the current spee.ch site is capable of.</p>
<h3>A Common Codebase</h3>
<p>If you have been following the project, you may have already noticed that the original github repository has grown into three: <a href={'https://github.com/lbryio/www.spee.ch'} target={'_blank'}>www.spee.ch</a>, <a href={'https://github.com/lbryio/spee.ch'} target={'_blank'}>spee.ch</a>, and <a href={'https://github.com/lbryio/spee.ch-components'} target={'_blank'}>spee.ch-components</a>. I will save the specifics for a future tech-focused blog post in the coming weeks, but the reason for these changes is to modularise the code so that is it easier for anyone who wants to run their own version of Spee.ch to do so, and to be able to customize their Spee.ch to their liking.</p>
<p>If you have been following the project, you may have already noticed that the original github repository has grown into two: <a href={'https://github.com/lbryio/www.spee.ch'} target={'_blank'}>www.spee.ch</a> and <a href={'https://github.com/lbryio/spee.ch'} target={'_blank'}>spee.ch</a>. I will save the specifics for a future tech-focused blog post in the coming weeks, but the reason for these changes is to modularise the code so that is it easier for anyone who wants to run their own version of Spee.ch to do so, and to be able to customize their Spee.ch to their liking.</p>
<h3>What About the Flagship Spee.ch Site?</h3>
<p>Dont worry! If you like using <a href={'https://spee.ch'} target={'_blank'}>Spee.ch</a> and have no intention of running your own site, we will still be here running it for you! We are dedicated to pushing it forward and using it as patient zero for all additions to the Spee.ch Multisite codebase.</p>
<h2>Join Us</h2>

View file

@ -14,7 +14,7 @@ const mysqlConfig = require('./config/mysqlConfig.js');
const siteConfig = require('./config/siteConfig.js');
const slackConfig = require('./config/slackConfig.js');
const createDatabaseIfNotExists = require('./server/models/utils/createDatabaseIfNotExists.js');
const { getWalletBalance } = require('./server/lbrynet');
const { getWalletBalance } = require('./server/lbrynet/index');
function Server () {
this.configureLogger = loggerConfig.update;
@ -48,7 +48,7 @@ function Server () {
app.use(requestLogger);
// configure passport
const speechPassport = require('./server/speechPassport');
const speechPassport = require('./server/speechPassport/index');
// initialize passport
const sessionKey = siteConfig.auth.sessionKey;
app.use(cookieSession({
@ -67,11 +67,11 @@ function Server () {
app.set('view engine', 'handlebars');
// set the routes on the app
require('./server/routes/auth')(app);
require('./server/routes/api')(app);
require('./server/routes/pages')(app);
require('./server/routes/assets')(app);
require('./server/routes/fallback')(app);
require('./server/routes/auth/index')(app);
require('./server/routes/api/index')(app);
require('./server/routes/pages/index')(app);
require('./server/routes/assets/index')(app);
require('./server/routes/fallback/index')(app);
this.app = app;
};
@ -80,7 +80,7 @@ function Server () {
this.server = http.Server(this.app);
};
this.start = () => {
const db = require('./server/models');
const db = require('./server/models/index');
const PORT = siteConfig.details.port;
// sync sequelize
createDatabaseIfNotExists()

View file

@ -23,7 +23,7 @@
"lbry",
"blockchain"
],
"author": "@billbitt @kauffj @filipnyquist",
"author": "@lbryio",
"license": "MIT",
"bugs": {
"url": "https://github.com/lbryio/spee.ch/issues"

View file

@ -10,7 +10,11 @@ var _reactRedux = require("react-redux");
var _reactRouterDom = require("react-router-dom");
var _spee = require("spee.ch-components");
var _reducers = _interopRequireDefault(require("client/build/reducers"));
var _GAListener = _interopRequireDefault(require("client/build/components/GAListener"));
var _app = _interopRequireDefault(require("client/build/app.js"));
var _renderFullPage = _interopRequireDefault(require("../renderFullPage.js"));
@ -23,9 +27,9 @@ var siteConfig = require('../../../config/siteConfig.js');
module.exports = function (req, res) {
var context = {}; // customize the reducer by passing in intial state configs
var MyReducers = (0, _spee.Reducers)(siteConfig);
var MyApp = _spee.App;
var MyGAListener = (0, _spee.GAListener)(siteConfig); // create a new Redux store instance
var MyReducers = (0, _reducers.default)(siteConfig);
var MyApp = _app.default;
var MyGAListener = (0, _GAListener.default)(siteConfig); // create a new Redux store instance
var store = (0, _redux.createStore)(MyReducers); // render component to a string

View file

@ -16,7 +16,15 @@ var _reduxSaga = _interopRequireDefault(require("redux-saga"));
var _effects = require("redux-saga/effects");
var _spee = require("spee.ch-components");
var _reducers = _interopRequireDefault(require("client/build/reducers"));
var _GAListener = _interopRequireDefault(require("client/build/components/GAListener"));
var _app = _interopRequireDefault(require("client/build/app.js"));
var _sagas = _interopRequireDefault(require("client/build/sagas"));
var _actions = _interopRequireDefault(require("client/build/actions"));
var _reactHelmet = _interopRequireDefault(require("react-helmet"));
@ -48,18 +56,18 @@ var returnSagaWithParams = function returnSagaWithParams(saga, params) {
module.exports = function (req, res) {
var context = {}; // configure the reducers by passing initial state configs
var MyReducers = (0, _spee.Reducers)(siteConfig);
var MyApp = _spee.App;
var MyGAListener = (0, _spee.GAListener)(siteConfig); // create and apply middleware
var MyReducers = (0, _reducers.default)(siteConfig);
var MyApp = _app.default;
var MyGAListener = (0, _GAListener.default)(siteConfig); // create and apply middleware
var sagaMiddleware = (0, _reduxSaga.default)();
var middleware = (0, _redux.applyMiddleware)(sagaMiddleware); // create a new Redux store instance
var store = (0, _redux.createStore)(MyReducers, middleware); // create saga
var action = _spee.Actions.onHandleShowPageUri(req.params);
var action = _actions.default.onHandleShowPageUri(req.params);
var saga = returnSagaWithParams(_spee.Sagas.handleShowPageUri, action); // run the saga middleware
var saga = returnSagaWithParams(_sagas.default.handleShowPageUri, action); // run the saga middleware
sagaMiddleware.run(saga).done.then(function () {
// render component to a string

View file

@ -3,7 +3,9 @@ import { renderToString } from 'react-dom/server';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import { StaticRouter } from 'react-router-dom';
import { Reducers, GAListener, App } from 'spee.ch-components';
import Reducers from 'client/build/reducers';
import GAListener from 'client/build/components/GAListener';
import App from 'client/build/app.js';
import renderFullPage from '../renderFullPage.js';
import Helmet from 'react-helmet';

View file

@ -6,7 +6,11 @@ import { StaticRouter } from 'react-router-dom';
import renderFullPage from '../renderFullPage';
import createSagaMiddleware from 'redux-saga';
import { call } from 'redux-saga/effects';
import { Reducers, GAListener, App, Sagas, Actions } from 'spee.ch-components';
import Reducers from 'client/build/reducers';
import GAListener from 'client/build/components/GAListener';
import App from 'client/build/app.js';
import Sagas from 'client/build/sagas';
import Actions from 'client/build/actions';
import Helmet from 'react-helmet';
const siteConfig = require('../../../config/siteConfig.js');