-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapps.js
More file actions
40 lines (36 loc) · 1.22 KB
/
apps.js
File metadata and controls
40 lines (36 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
const apps = {
app: './src/index.tsx',
core: './src/core/main.ts',
rap: './src/graphic/applications/AppReviewAndPlan.tsx',
netoDashboards: './src/graphic/Neto-Dashboards/index.tsx',
infraTextTailor: './src/graphic/Infra-Tools/index.tsx',
};
const getDevApplication = (app) => {
if (app.includes(',')) {
return getApplicationsToBeBuilt(app, true);
}
const entry = {[app]: apps[app] || apps.app};
if (!entry.app) {entry.app = apps[app] || apps.app;}
console.log(`Developing the ${JSON.stringify(entry)} app.`);
return entry;
};
const getApplicationsToBeBuilt = (env, dev = false) => {
if (!env || env === 'all') {
console.log(`${dev ? 'Developing' : 'Building'} All Available Applications:`);
console.log(JSON.stringify(apps, undefined, '\t'));
return apps;
}
const entry = {};
const invalid = [];
env.split(',').map(app => apps[app] ? entry[app] = apps[app] : invalid.push(app));
console.log(`Applications to be ${dev ? 'developed' : 'built'}:`);
invalid.length > 0 && console.error('> Invalid Applications:', invalid);
console.log(JSON.stringify(entry, undefined, '\t'));
return Object.keys(entry).length === 0 ? {app: apps.app} : entry;
};
module.exports = {
apps,
getDevApplication,
getApplicationsToBeBuilt,
};