Speech as a package - export components #401

Merged
bones7242 merged 8 commits from speech-as-a-package-export-component-lib into speech-as-a-package 2018-03-22 06:11:03 +01:00
10 changed files with 798 additions and 1032 deletions
Showing only changes of commit 94d4626ccf - Show all commits

View file

@ -0,0 +1,22 @@
const { lstatSync, readdirSync } = require('fs');
const { join } = require('path');
const getSubDirectoryNames = (root) => {
console.log('getting sub directories for:', root);
return readdirSync(root)
.filter(name => {
console.log('module found:', name);
let fullPath = join(root, name);
return lstatSync(fullPath).isDirectory();
});
};
module.exports = (root) => {
let allModules = {};
getSubDirectoryNames(root)
.forEach((name) => {
console.log('importing module:', name);
allModules[name] = require(`./${name}`).default;
});
return allModules;
};

View file

@ -1,25 +1,4 @@
import ActiveStatusBar from './ActiveStatusBar';
import AssetPreview from './AssetPreview';
import ExpandingTextArea from './ExpandingTextArea';
import GAListener from './GAListener';
import InactiveStatusBar from './InactiveStatusBar';
import Logo from './Logo';
import NavBarChannelOptionsDropdown from './NavBarChannelOptionsDropdown';
import ProgressBar from './ProgressBar';
import PublishPreview from './PublishPreview';
import PublishUrlMiddleDisplay from './PublishUrlMiddleDisplay';
import SEO from './SEO';
module.exports = {
ActiveStatusBar,
AssetPreview,
ExpandingTextArea,
GAListener,
InactiveStatusBar,
Logo,
NavBarChannelOptionsDropdown,
ProgressBar,
PublishPreview,
PublishUrlMiddleDisplay,
SEO,
};
const Path = require('path');
const importSubModules = require('build/utils/importSubModules');
const thisFolder = Path.resolve(__dirname, 'client/components/');
module.exports = importSubModules(thisFolder);

View file

@ -0,0 +1,4 @@
const Path = require('path');
const importSubModules = require('build/utils/importSubModules');
const thisFolder = Path.resolve(__dirname, 'client/containers/');
module.exports = importSubModules(thisFolder);

4
client/pages/index.js Normal file
View file

@ -0,0 +1,4 @@
const Path = require('path');
const importSubModules = require('build/utils/importSubModules');
const thisFolder = Path.resolve(__dirname, 'client/pages/');
module.exports = importSubModules(thisFolder);

1743
index.js

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,4 @@
const db = require('../models/index');
const db = require('../models');
const logger = require('winston');
module.exports = {

View file

@ -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';

View file

@ -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(
{

View file

@ -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);

View file

@ -1,13 +1,13 @@
const Server = require('server/server.js');
const Components = require('client/components');
// const containers = require('client/containers');
// const pages = require('client/pages');
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,
Containers,
Pages,
};
module.exports = exports;