Speech as a package - export components #401
18 changed files with 88 additions and 54707 deletions
10
build/getFolderNames.js
Normal file
10
build/getFolderNames.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
nice nice
I would use I would use `const` if you aren't changing anything
nice nice
|
||||
const { lstatSync, readdirSync } = require('fs');
|
||||
I would use I would use `const` if you aren't changing anything
nice nice
|
||||
const { join } = require('path');
|
||||
I would use I would use `const` if you aren't changing anything
nice nice
|
||||
|
||||
I would use I would use `const` if you aren't changing anything
nice nice
|
||||
export const getSubDirectoryNames = (root) => {
|
||||
I would use I would use `const` if you aren't changing anything
nice nice
|
||||
return readdirSync(root)
|
||||
I would use I would use `const` if you aren't changing anything
nice nice
|
||||
.filter(name => {
|
||||
I would use I would use `const` if you aren't changing anything
nice nice
|
||||
const fullPath = join(root, name);
|
||||
I would use I would use `const` if you aren't changing anything
nice nice
|
||||
return lstatSync(fullPath).isDirectory();
|
||||
I would use I would use `const` if you aren't changing anything
nice nice
|
||||
});
|
||||
I would use I would use `const` if you aren't changing anything
nice nice
|
||||
};
|
||||
I would use I would use `const` if you aren't changing anything
nice nice
|
12
client/components/index.js
Normal file
12
client/components/index.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
const Path = require('path');
|
||||
const { getSubDirectoryNames } = require('build/getFolderNames.js');
|
||||
|
||||
const thisFolder = Path.resolve(__dirname, 'client/components/');
|
||||
let modules = {};
|
||||
|
||||
getSubDirectoryNames(thisFolder)
|
||||
.forEach((name) => {
|
||||
modules[name] = require(`./${name}`).default;
|
||||
});
|
||||
|
||||
module.exports = modules;
|
12
client/containers/index.js
Normal file
12
client/containers/index.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
const Path = require('path');
|
||||
const { getSubDirectoryNames } = require('build/getFolderNames.js');
|
||||
const thisFolder = Path.resolve(__dirname, 'client/containers/');
|
||||
|
||||
let modules = {};
|
||||
|
||||
getSubDirectoryNames(thisFolder)
|
||||
.forEach((name) => {
|
||||
modules[name] = require(`./${name}`).default;
|
||||
});
|
||||
|
||||
module.exports = modules;
|
12
client/pages/index.js
Normal file
12
client/pages/index.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
const Path = require('path');
|
||||
const { getSubDirectoryNames } = require('build/getFolderNames.js');
|
||||
const thisFolder = Path.resolve(__dirname, 'client/pages/');
|
||||
|
||||
let modules = {};
|
||||
|
||||
getSubDirectoryNames(thisFolder)
|
||||
.forEach((name) => {
|
||||
modules[name] = require(`./${name}`).default;
|
||||
});
|
||||
|
||||
module.exports = modules;
|
8919
index.js
8919
index.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
45776
public/bundle/bundle.js
45776
public/bundle/bundle.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,4 @@
|
|||
const db = require('../models/index');
|
||||
const db = require('../models');
|
||||
const logger = require('winston');
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import React from 'react';
|
||||
import { renderToString } from 'react-dom/server';
|
||||
import { createStore } from 'redux';
|
||||
import Reducer from '../../client/reducers/index';
|
||||
import Reducer from 'client/reducers';
|
||||
import { Provider } from 'react-redux';
|
||||
import { StaticRouter } from 'react-router-dom';
|
||||
import GAListener from '../../client/components/GAListener/index';
|
||||
import App from '../../client/app';
|
||||
import GAListener from 'client/components/GAListener/';
|
||||
import App from 'client/app';
|
||||
import renderFullPage from './renderFullPage.js';
|
||||
import Helmet from 'react-helmet';
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const PassportLocalStrategy = require('passport-local').Strategy;
|
||||
const lbryApi = require('../helpers/lbryApi.js');
|
||||
const logger = require('winston');
|
||||
const db = require('../models/index');
|
||||
const db = require('../models');
|
||||
|
||||
module.exports = new PassportLocalStrategy(
|
||||
{
|
||||
|
|
|
@ -11,13 +11,12 @@ const http = require('http');
|
|||
// logging dependencies
|
||||
const logger = require('winston');
|
||||
|
||||
function SpeechServer () {
|
||||
function Server () {
|
||||
this.configureMysql = (mysqlConfig) => {
|
||||
require('../config/mysqlConfig.js').configure(mysqlConfig);
|
||||
};
|
||||
this.configureSite = (siteConfig) => {
|
||||
require('../config/siteConfig.js').configure(siteConfig);
|
||||
console.log(require('../config/siteConfig.js'));
|
||||
this.sessionKey = siteConfig.auth.sessionKey;
|
||||
this.PORT = siteConfig.details.port;
|
||||
};
|
||||
|
@ -96,4 +95,4 @@ function SpeechServer () {
|
|||
};
|
||||
};
|
||||
|
||||
module.exports = SpeechServer;
|
||||
module.exports = Server;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// load dependencies
|
||||
const logger = require('winston');
|
||||
const db = require('../models/index'); // require our models for syncing
|
||||
const db = require('../models'); // require our models for syncing
|
||||
// configure logging
|
||||
require('../helpers/configureLogger.js')(logger);
|
||||
|
||||
|
|
13
speech.js
Normal file
13
speech.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
const Server = require('./server/server.js');
|
||||
const Components = require('./client/components');
|
||||
const Containers = require('./client/containers');
|
||||
const Pages = require('./client/pages');
|
||||
|
||||
const exports = {
|
||||
Server,
|
||||
Components,
|
||||
Containers,
|
||||
Pages,
|
||||
};
|
||||
|
||||
module.exports = exports;
|
|
@ -1,7 +1,7 @@
|
|||
const serverBaseConfig = require('./webpack.server.common.js');
|
||||
const packageBaseConfig = require('./webpack.package.common.js');
|
||||
const clientBaseConfig = require('./webpack.client.common.js');
|
||||
|
||||
module.exports = [
|
||||
serverBaseConfig,
|
||||
packageBaseConfig,
|
||||
clientBaseConfig,
|
||||
];
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const serverBaseConfig = require('./webpack.server.common.js');
|
||||
const packageBaseConfig = require('./webpack.package.common.js');
|
||||
const clientBaseConfig = require('./webpack.client.common.js');
|
||||
const merge = require('webpack-merge');
|
||||
|
||||
|
@ -8,6 +8,6 @@ const devBuildConfig = {
|
|||
};
|
||||
|
||||
module.exports = [
|
||||
merge(serverBaseConfig, devBuildConfig),
|
||||
merge(packageBaseConfig, devBuildConfig),
|
||||
merge(clientBaseConfig, devBuildConfig),
|
||||
];
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
const Path = require('path');
|
||||
const nodeExternals = require('webpack-node-externals');
|
||||
const REACT_ROOT = Path.resolve(__dirname, 'client/');
|
||||
const CLIENT_ROOT = Path.resolve(__dirname, 'client/');
|
||||
const SERVER_ROOT = Path.resolve(__dirname, 'server/');
|
||||
|
||||
module.exports = {
|
||||
target: 'node',
|
||||
|
@ -8,7 +9,7 @@ module.exports = {
|
|||
__dirname: false,
|
||||
},
|
||||
externals: [nodeExternals()],
|
||||
entry : ['babel-polyfill', 'whatwg-fetch', './server/server.js'],
|
||||
entry : ['babel-polyfill', 'whatwg-fetch', './speech.js'],
|
||||
output : {
|
||||
path : Path.join(__dirname, '/'),
|
||||
publicPath : '/',
|
||||
|
@ -34,7 +35,8 @@ module.exports = {
|
|||
},
|
||||
resolve: {
|
||||
modules: [
|
||||
REACT_ROOT,
|
||||
CLIENT_ROOT,
|
||||
SERVER_ROOT,
|
||||
'node_modules',
|
||||
__dirname,
|
||||
],
|
|
@ -1,7 +1,7 @@
|
|||
const webpack = require('webpack');
|
||||
const merge = require('webpack-merge');
|
||||
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
|
||||
const serverBaseConfig = require('./webpack.server.common.js');
|
||||
const packageBaseConfig = require('./webpack.package.common.js');
|
||||
const clientBaseConfig = require('./webpack.client.common.js');
|
||||
|
||||
const productionBuildConfig = {
|
||||
|
@ -17,6 +17,6 @@ const productionBuildConfig = {
|
|||
};
|
||||
|
||||
module.exports = [
|
||||
merge(serverBaseConfig, productionBuildConfig),
|
||||
merge(packageBaseConfig, productionBuildConfig),
|
||||
merge(clientBaseConfig, productionBuildConfig),
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue
I would use
const
if you aren't changing anything