Speech as a package #416
9 changed files with 49 additions and 54837 deletions
10
build/getFolderNames.js
Normal file
10
build/getFolderNames.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
const { lstatSync, readdirSync } = require('fs');
|
||||||
|
const { join } = require('path');
|
||||||
|
|
||||||
|
export const getSubDirectoryNames = (root) => {
|
||||||
|
return readdirSync(root)
|
||||||
|
.filter(name => {
|
||||||
|
let fullPath = join(root, name);
|
||||||
|
return lstatSync(fullPath).isDirectory();
|
||||||
|
});
|
||||||
|
};
|
|
@ -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;
|
|
||||||
};
|
|
|
@ -1,4 +1,12 @@
|
||||||
const Path = require('path');
|
const Path = require('path');
|
||||||
const importSubModules = require('build/utils/importSubModules');
|
const { getSubDirectoryNames } = require('build/getFolderNames.js');
|
||||||
|
|
||||||
const thisFolder = Path.resolve(__dirname, 'client/components/');
|
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;
|
||||||
|
|
|
@ -1,4 +1,12 @@
|
||||||
const Path = require('path');
|
const Path = require('path');
|
||||||
const importSubModules = require('build/utils/importSubModules');
|
const { getSubDirectoryNames } = require('build/getFolderNames.js');
|
||||||
const thisFolder = Path.resolve(__dirname, 'client/containers/');
|
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;
|
||||||
|
|
|
@ -1,4 +1,12 @@
|
||||||
const Path = require('path');
|
const Path = require('path');
|
||||||
const importSubModules = require('build/utils/importSubModules');
|
const { getSubDirectoryNames } = require('build/getFolderNames.js');
|
||||||
const thisFolder = Path.resolve(__dirname, 'client/pages/');
|
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
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
45776
public/bundle/bundle.js
45776
public/bundle/bundle.js
File diff suppressed because one or more lines are too long
|
@ -17,7 +17,6 @@ function Server () {
|
||||||
};
|
};
|
||||||
this.configureSite = (siteConfig) => {
|
this.configureSite = (siteConfig) => {
|
||||||
require('../config/siteConfig.js').configure(siteConfig);
|
require('../config/siteConfig.js').configure(siteConfig);
|
||||||
console.log(require('../config/siteConfig.js'));
|
|
||||||
this.sessionKey = siteConfig.auth.sessionKey;
|
this.sessionKey = siteConfig.auth.sessionKey;
|
||||||
this.PORT = siteConfig.details.port;
|
this.PORT = siteConfig.details.port;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue