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
9 changed files with 49 additions and 54837 deletions
Showing only changes of commit 4a3ec31bc7 - Show all commits

10
build/getFolderNames.js Normal file
View file

@ -0,0 +1,10 @@
neb-b commented 2018-03-22 06:00:36 +01:00 (Migrated from github.com)
Review

I would use const if you aren't changing anything

I would use `const` if you aren't changing anything
bones7242 commented 2018-03-22 06:04:53 +01:00 (Migrated from github.com)
Review

nice

nice
neb-b commented 2018-03-22 06:00:36 +01:00 (Migrated from github.com)
Review

I would use const if you aren't changing anything

I would use `const` if you aren't changing anything
bones7242 commented 2018-03-22 06:04:53 +01:00 (Migrated from github.com)
Review

nice

nice
const { lstatSync, readdirSync } = require('fs');
neb-b commented 2018-03-22 06:00:36 +01:00 (Migrated from github.com)
Review

I would use const if you aren't changing anything

I would use `const` if you aren't changing anything
bones7242 commented 2018-03-22 06:04:53 +01:00 (Migrated from github.com)
Review

nice

nice
const { join } = require('path');
neb-b commented 2018-03-22 06:00:36 +01:00 (Migrated from github.com)
Review

I would use const if you aren't changing anything

I would use `const` if you aren't changing anything
bones7242 commented 2018-03-22 06:04:53 +01:00 (Migrated from github.com)
Review

nice

nice
neb-b commented 2018-03-22 06:00:36 +01:00 (Migrated from github.com)
Review

I would use const if you aren't changing anything

I would use `const` if you aren't changing anything
bones7242 commented 2018-03-22 06:04:53 +01:00 (Migrated from github.com)
Review

nice

nice
export const getSubDirectoryNames = (root) => {
neb-b commented 2018-03-22 06:00:36 +01:00 (Migrated from github.com)
Review

I would use const if you aren't changing anything

I would use `const` if you aren't changing anything
bones7242 commented 2018-03-22 06:04:53 +01:00 (Migrated from github.com)
Review

nice

nice
return readdirSync(root)
neb-b commented 2018-03-22 06:00:36 +01:00 (Migrated from github.com)
Review

I would use const if you aren't changing anything

I would use `const` if you aren't changing anything
bones7242 commented 2018-03-22 06:04:53 +01:00 (Migrated from github.com)
Review

nice

nice
.filter(name => {
neb-b commented 2018-03-22 06:00:36 +01:00 (Migrated from github.com)
Review

I would use const if you aren't changing anything

I would use `const` if you aren't changing anything
bones7242 commented 2018-03-22 06:04:53 +01:00 (Migrated from github.com)
Review

nice

nice
let fullPath = join(root, name);
neb-b commented 2018-03-22 06:00:36 +01:00 (Migrated from github.com)
Review

I would use const if you aren't changing anything

I would use `const` if you aren't changing anything
bones7242 commented 2018-03-22 06:04:53 +01:00 (Migrated from github.com)
Review

nice

nice
return lstatSync(fullPath).isDirectory();
neb-b commented 2018-03-22 06:00:36 +01:00 (Migrated from github.com)
Review

I would use const if you aren't changing anything

I would use `const` if you aren't changing anything
bones7242 commented 2018-03-22 06:04:53 +01:00 (Migrated from github.com)
Review

nice

nice
});
neb-b commented 2018-03-22 06:00:36 +01:00 (Migrated from github.com)
Review

I would use const if you aren't changing anything

I would use `const` if you aren't changing anything
bones7242 commented 2018-03-22 06:04:53 +01:00 (Migrated from github.com)
Review

nice

nice
};
neb-b commented 2018-03-22 06:00:36 +01:00 (Migrated from github.com)
Review

I would use const if you aren't changing anything

I would use `const` if you aren't changing anything
bones7242 commented 2018-03-22 06:04:53 +01:00 (Migrated from github.com)
Review

nice

nice

View file

@ -1,22 +0,0 @@
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,4 +1,12 @@
const Path = require('path');
const importSubModules = require('build/utils/importSubModules');
const { getSubDirectoryNames } = require('build/getFolderNames.js');
const thisFolder = Path.resolve(__dirname, 'client/components/');
module.exports = importSubModules(thisFolder);
let modules = {};
getSubDirectoryNames(thisFolder)
.forEach((name) => {
modules[name] = require(`./${name}`).default;
});
module.exports = modules;

View file

@ -1,4 +1,12 @@
const Path = require('path');
const importSubModules = require('build/utils/importSubModules');
const { getSubDirectoryNames } = require('build/getFolderNames.js');
const thisFolder = Path.resolve(__dirname, 'client/containers/');
module.exports = importSubModules(thisFolder);
let modules = {};
getSubDirectoryNames(thisFolder)
.forEach((name) => {
modules[name] = require(`./${name}`).default;
});
module.exports = modules;

View file

@ -1,4 +1,12 @@
const Path = require('path');
const importSubModules = require('build/utils/importSubModules');
const { getSubDirectoryNames } = require('build/getFolderNames.js');
const thisFolder = Path.resolve(__dirname, 'client/pages/');
module.exports = importSubModules(thisFolder);
let modules = {};
getSubDirectoryNames(thisFolder)
.forEach((name) => {
modules[name] = require(`./${name}`).default;
});
module.exports = modules;

9039
index.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -17,7 +17,6 @@ function Server () {
};
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;
};