cob-cli 2.25.0 → 2.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cob-cli.js +3 -1
- package/bin/handleAutoComplete.js +1 -4
- package/lib/commands/customize.js +213 -66
- package/package.json +3 -2
- package/.vscode/launch.json +0 -106
- package/customizations/backend.email.js +0 -10
- package/customizations/backend.js +0 -14
- package/customizations/backend.updateField.js +0 -11
- package/customizations/backend.vuepress.js +0 -35
- package/customizations/dashboard.dash.js +0 -14
- package/customizations/dashboard.js +0 -14
- package/customizations/dashboard.simple.js +0 -12
- package/customizations/dashboard.vue.empty.js +0 -12
- package/customizations/dashboard.vue.grid.js +0 -10
- package/customizations/dashboard.vue.js +0 -14
- package/customizations/dashboard.vue.menuAndGrid.js +0 -10
- package/customizations/frontend.common.js +0 -16
- package/customizations/frontend.easy.js +0 -16
- package/customizations/frontend.formatList.currency.js +0 -17
- package/customizations/frontend.formatList.js +0 -13
- package/customizations/frontend.js +0 -14
- package/customizations/importer.js +0 -10
- package/customizations/keywords.audit.js +0 -18
- package/customizations/keywords.calc.js +0 -18
- package/customizations/keywords.image.js +0 -16
- package/customizations/keywords.js +0 -17
- package/customizations/keywords.kibana.js +0 -16
- package/customizations/keywords.log.js +0 -18
- package/customizations/keywords.styleResults.js +0 -18
- package/templates/backend/vuepress/integrationm/actions/getVuePressDoc.groovy +0 -74
- package/templates/backend/vuepress/integrationm/actions/getVuePressSidebarConfig.groovy +0 -42
- package/templates/backend/vuepress/integrationm/actions/getVuePressSidebarRootElements.groovy +0 -17
- package/templates/backend/vuepress/others/vuepress/definition_contents_v234.json +0 -619
- package/templates/backend/vuepress/others/vuepress/nginx/README.md +0 -28
- package/templates/backend/vuepress/others/vuepress/package-lock.json +0 -29656
- package/templates/backend/vuepress/others/vuepress/package.json +0 -24
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/DescriptVideo.vue +0 -22
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/Graph.vue +0 -124
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/ReadingTime.vue +0 -26
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/References.vue +0 -228
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/RestrictedContent.vue +0 -77
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/config.js +0 -101
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/config.json +0 -31
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/enhanceApp.js +0 -14
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/nav/getNavTranslated.js +0 -52
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/plugins/References.js +0 -96
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/Logo-Cult-of-Bits-400x400-1.png +0 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/favicon-cob.png +0 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/logo.png +0 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/styles/index.styl +0 -39
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/styles/palette.styl +0 -17
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/LICENSE +0 -21
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/README.md +0 -11
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/AlgoliaSearchBox.vue +0 -172
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/DropdownLink.vue +0 -252
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/DropdownTransition.vue +0 -33
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Home.vue +0 -134
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/NavLink.vue +0 -98
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/NavLinks.vue +0 -165
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Navbar.vue +0 -140
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Page.vue +0 -31
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/PageEdit.vue +0 -119
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/PageNav.vue +0 -163
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Sidebar.vue +0 -64
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarButton.vue +0 -40
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarGroup.vue +0 -144
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarLink.vue +0 -140
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarLinks.vue +0 -114
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/Badge.vue +0 -44
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/CodeBlock.vue +0 -41
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/CodeGroup.vue +0 -120
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/index.js +0 -59
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/layouts/404.vue +0 -30
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/layouts/Layout.vue +0 -151
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/noopModule.js +0 -1
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/package.json +0 -44
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/arrow.styl +0 -22
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/code.styl +0 -137
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/config.styl +0 -1
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/custom-blocks.styl +0 -44
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/index.styl +0 -202
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/mobile.styl +0 -37
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/toc.styl +0 -3
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/wrapper.styl +0 -10
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/util/index.js +0 -244
- package/templates/dashboards/cob-dashboard-html/demoDashboard.html +0 -18
- package/templates/dashboards/cob-dashboard-vue/package-lock.json +0 -25020
- package/templates/dashboards/cob-dashboard-vue/package.json +0 -21
- package/templates/dashboards/cob-dashboard-vue/src/App.vue +0 -26
- package/templates/dashboards/cob-dashboard-vue/src/dashboard.html +0 -31
- package/templates/dashboards/cob-dashboard-vue/src/main.js +0 -12
- package/templates/dashboards/cob-dashboard-vue/src/plugins/cobUiVueComponents.js +0 -6
- package/templates/dashboards/cob-dashboard-vue/src/plugins/vuetify.js +0 -9
- package/templates/dashboards/cob-dashboard-vue/vue.config.js +0 -104
- package/templates/dashboards/dash/dist/css/app.7b16c01a.css +0 -11
- package/templates/dashboards/dash/dist/dashboard.html +0 -25
- package/templates/dashboards/dash/dist/fonts/fa-brands-400.a78ffbbe.ttf +0 -0
- package/templates/dashboards/dash/dist/fonts/fa-brands-400.cd2b4095.woff2 +0 -0
- package/templates/dashboards/dash/dist/fonts/fa-regular-400.b1a1bebb.ttf +0 -0
- package/templates/dashboards/dash/dist/fonts/fa-regular-400.e8a1ba41.woff2 +0 -0
- package/templates/dashboards/dash/dist/fonts/fa-solid-900.55b416a8.woff2 +0 -0
- package/templates/dashboards/dash/dist/fonts/fa-solid-900.73820155.ttf +0 -0
- package/templates/dashboards/dash/dist/fonts/fa-v4compatibility.0d6f5f18.ttf +0 -0
- package/templates/dashboards/dash/dist/fonts/fa-v4compatibility.786e6b33.woff2 +0 -0
- package/templates/dashboards/dash/dist/js/app.13b950c8.js +0 -199
- package/templates/dashboards/dash/dist/js/app.13b950c8.js.map +0 -1
- package/templates/dashboards/dash/package-lock.json +0 -22646
- package/templates/dashboards/dash/package.json +0 -27
- package/templates/dashboards/dash/src/App.vue +0 -124
- package/templates/dashboards/dash/src/assets/css/all.min.css +0 -6
- package/templates/dashboards/dash/src/assets/webfonts/fa-brands-400.ttf +0 -0
- package/templates/dashboards/dash/src/assets/webfonts/fa-brands-400.woff2 +0 -0
- package/templates/dashboards/dash/src/assets/webfonts/fa-regular-400.ttf +0 -0
- package/templates/dashboards/dash/src/assets/webfonts/fa-regular-400.woff2 +0 -0
- package/templates/dashboards/dash/src/assets/webfonts/fa-solid-900.ttf +0 -0
- package/templates/dashboards/dash/src/assets/webfonts/fa-solid-900.woff2 +0 -0
- package/templates/dashboards/dash/src/assets/webfonts/fa-v4compatibility.ttf +0 -0
- package/templates/dashboards/dash/src/assets/webfonts/fa-v4compatibility.woff2 +0 -0
- package/templates/dashboards/dash/src/collector.js +0 -222
- package/templates/dashboards/dash/src/components/Attention.vue +0 -30
- package/templates/dashboards/dash/src/components/Board.vue +0 -35
- package/templates/dashboards/dash/src/components/Calendar.vue +0 -422
- package/templates/dashboards/dash/src/components/Dashboard.vue +0 -27
- package/templates/dashboards/dash/src/components/Filter.vue +0 -68
- package/templates/dashboards/dash/src/components/Kibana.vue +0 -138
- package/templates/dashboards/dash/src/components/Label.vue +0 -15
- package/templates/dashboards/dash/src/components/Menu.vue +0 -44
- package/templates/dashboards/dash/src/components/Totals.vue +0 -49
- package/templates/dashboards/dash/src/components/TotalsValue.vue +0 -59
- package/templates/dashboards/dash/src/components/shared/Instance.vue +0 -64
- package/templates/dashboards/dash/src/components/shared/Waiting.vue +0 -25
- package/templates/dashboards/dash/src/dashboard.html +0 -39
- package/templates/dashboards/dash/src/definition_dashboard_v0.json +0 -924
- package/templates/dashboards/dash/src/definition_dashboard_v1.json +0 -1
- package/templates/dashboards/dash/src/input.css +0 -9
- package/templates/dashboards/dash/src/main.js +0 -11
- package/templates/dashboards/dash/src/model/ComponentStatePersistence.js +0 -66
- package/templates/dashboards/dash/src/output.css +0 -314245
- package/templates/dashboards/dash/src/test_collector.js +0 -3719
- package/templates/dashboards/dash/src/utils/EsInstanceUtils.js +0 -8
- package/templates/dashboards/dash/tailwind.config.js +0 -12
- package/templates/dashboards/dash/vue.config.js +0 -104
- package/templates/frontend/common/templates/frontend/common/css/_dualColumn.css +0 -46
- package/templates/frontend/common/templates/frontend/common/css/_global.css +0 -19
- package/templates/frontend/common/templates/frontend/common/css/_hidden.css +0 -13
- package/templates/frontend/common/templates/frontend/common/css/_history.css +0 -13
- package/templates/frontend/common/templates/frontend/common/css/_mobile.css +0 -125
- package/templates/frontend/common/templates/frontend/common/css/customizations.__MERGE__.css +0 -5
- package/templates/frontend/common/templates/frontend/common/js/cob/_disable_save_onSubdetail.js +0 -11
- package/templates/frontend/common/templates/frontend/common/js/cob/_group_references.js +0 -22
- package/templates/frontend/common/templates/frontend/common/js/cob/_show_hidden.js +0 -35
- package/templates/frontend/common/templates/frontend/common/js/customizations2.__MERGE__.js +0 -3
- package/templates/frontend/common/templates/frontend/common/package.json +0 -3
- package/templates/frontend/easy/css/_easy/googlefonts.css +0 -360
- package/templates/frontend/easy/css/_easy/vuetify.cob-scoped.css +0 -10488
- package/templates/frontend/easy/js/_easy/lib/axios.min.js +0 -9
- package/templates/frontend/easy/js/_easy/lib/marked.min.js +0 -6
- package/templates/frontend/easy/js/_easy/lib/vue.js +0 -11912
- package/templates/frontend/easy/js/_easy/lib/vue.min.js +0 -6
- package/templates/frontend/easy/js/_easy/lib/vuetify.min.js +0 -6
- package/templates/frontend/easy/js/customizations2.__MERGE__.js +0 -22
- package/templates/frontend/easy/webapp/.browserslistrc +0 -2
- package/templates/frontend/easy/webapp/.eslintrc.js +0 -17
- package/templates/frontend/easy/webapp/README.md +0 -60
- package/templates/frontend/easy/webapp/babel.config.js +0 -5
- package/templates/frontend/easy/webapp/dist/css/app.a4fb91f8.css +0 -1
- package/templates/frontend/easy/webapp/dist/dashboard.html +0 -13
- package/templates/frontend/easy/webapp/dist/js/app.63a57dcd.js +0 -2
- package/templates/frontend/easy/webapp/dist/js/app.63a57dcd.js.map +0 -1
- package/templates/frontend/easy/webapp/package-lock.json +0 -32986
- package/templates/frontend/easy/webapp/package.json +0 -32
- package/templates/frontend/easy/webapp/postcss.config.js +0 -5
- package/templates/frontend/easy/webapp/public/dashboard.html +0 -13
- package/templates/frontend/easy/webapp/src/App.vue +0 -181
- package/templates/frontend/easy/webapp/src/assets/logo.png +0 -0
- package/templates/frontend/easy/webapp/src/components/HelloWorld.vue +0 -59
- package/templates/frontend/easy/webapp/src/components/PermBuilder.vue +0 -163
- package/templates/frontend/easy/webapp/src/components/PlanExecutor.vue +0 -225
- package/templates/frontend/easy/webapp/src/components/ProductPermBuilder.vue +0 -95
- package/templates/frontend/easy/webapp/src/components/RmDefinitionChooser.vue +0 -59
- package/templates/frontend/easy/webapp/src/components/RmDomainChooser.vue +0 -60
- package/templates/frontend/easy/webapp/src/components/RoleBuilder.vue +0 -73
- package/templates/frontend/easy/webapp/src/main.js +0 -19
- package/templates/frontend/easy/webapp/src/perm-templates.js +0 -189
- package/templates/frontend/easy/webapp/src/perms.js +0 -197
- package/templates/frontend/easy/webapp/vue.config.js +0 -66
- package/templates/frontend/formatList/currency/css/_format_currency.css +0 -11
- package/templates/frontend/formatList/currency/css/customizations.__MERGE__.css +0 -1
- package/templates/frontend/formatList/currency/js/cob/_format_currency.js +0 -11
- package/templates/frontend/formatList/currency/js/customizations2.__MERGE__.js +0 -1
- package/templates/frontend/formatList/currency/package.json +0 -3
- package/templates/gitignore +0 -14
- package/templates/keywords/audit/backend/scripts/_audit.groovy +0 -78
- package/templates/keywords/audit/frontend/js/cob/_audit.js +0 -24
- package/templates/keywords/audit/frontend/js/customizations2.__MERGE__.js +0 -1
- package/templates/keywords/audit/package.json +0 -3
- package/templates/keywords/calc/backend/scripts/_calc.groovy +0 -151
- package/templates/keywords/calc/frontend/js/cob/_calc.js +0 -193
- package/templates/keywords/calc/frontend/js/customizations2.__MERGE__.js +0 -1
- package/templates/keywords/calc/package.json +0 -3
- package/templates/keywords/image/frontend/js/cob/_image.js +0 -30
- package/templates/keywords/image/frontend/js/customizations2.__MERGE__.js +0 -1
- package/templates/keywords/image/package.json +0 -3
- package/templates/keywords/kibana/frontend/js/cob/_kibana.js +0 -58
- package/templates/keywords/kibana/frontend/js/customizations2.__MERGE__.js +0 -1
- package/templates/keywords/kibana/package.json +0 -3
- package/templates/keywords/log/backend/scripts/_log.groovy +0 -95
- package/templates/keywords/log/frontend/css/_log.css +0 -5
- package/templates/keywords/log/frontend/css/customizations.__MERGE__.css +0 -1
- package/templates/keywords/log/package.json +0 -3
- package/templates/keywords/styleResults/frontend/css/_styleResults.css +0 -86
- package/templates/keywords/styleResults/frontend/css/customizations.__MERGE__.css +0 -1
- package/templates/keywords/styleResults/frontend/js/cob/_styleResults.js +0 -38
- package/templates/keywords/styleResults/frontend/js/customizations2.__MERGE__.js +0 -1
- package/templates/keywords/styleResults/package.json +0 -3
package/bin/cob-cli.js
CHANGED
|
@@ -35,8 +35,10 @@ program
|
|
|
35
35
|
|
|
36
36
|
program
|
|
37
37
|
.command('customize')
|
|
38
|
-
.arguments('[name]', "Name
|
|
38
|
+
.arguments('[name]', "Name to filter the list of customizations", "interactive menu")
|
|
39
39
|
.option('-f --force', 'skips comparisons')
|
|
40
|
+
.option('-c --cache', 'cache all customizations')
|
|
41
|
+
.option('-l --local', 'use local files')
|
|
40
42
|
.description('Interactive prompt to customize an aspect of the server')
|
|
41
43
|
.action( customize );
|
|
42
44
|
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
-
const directoryPath = path.join(__dirname,"../customizations/");
|
|
3
|
-
|
|
4
|
-
const files = () => require('fs').readdirSync(directoryPath).map(f => f.substr(0,f.lastIndexOf(".")))
|
|
5
2
|
|
|
6
3
|
/* Autocomplete Component*/
|
|
7
4
|
var omelette = require('omelette');
|
|
8
5
|
const commandStructure = {
|
|
9
6
|
'init' : [],
|
|
10
|
-
'customize' :
|
|
7
|
+
'customize' : [],
|
|
11
8
|
'test' : [],
|
|
12
9
|
'deploy' : [],
|
|
13
10
|
'updateFromServer' : [],
|
|
@@ -1,90 +1,237 @@
|
|
|
1
1
|
const inquirer = require('inquirer');
|
|
2
|
-
const colors = require(
|
|
3
|
-
const
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const { checkWorkingCopyCleanliness } = require("../task_lists/common_helpers");
|
|
2
|
+
const colors = require("colors");
|
|
3
|
+
const path = require("path");
|
|
6
4
|
const { checkVersion } = require("./upgradeRepo");
|
|
5
|
+
const { checkWorkingCopyCleanliness } = require("../task_lists/common_helpers");
|
|
6
|
+
const axios = require("axios");
|
|
7
|
+
const git = require("simple-git/promise");
|
|
8
|
+
const ncp = require("ncp");
|
|
9
|
+
const { Transform } = require("stream");
|
|
10
|
+
const fg = require("fast-glob");
|
|
11
|
+
const fs = require("fs-extra");
|
|
7
12
|
|
|
8
13
|
/* ************************************************************************ */
|
|
9
|
-
async function customize(
|
|
14
|
+
async function customize(customizationArg, otherArgs) {
|
|
10
15
|
try {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if(!
|
|
14
|
-
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
16
|
+
console.log("Customize...");
|
|
17
|
+
checkVersion();
|
|
18
|
+
if (!otherArgs.force) await checkWorkingCopyCleanliness();
|
|
19
|
+
|
|
20
|
+
let repo = await getCustomizationRepo(customizationArg,otherArgs);
|
|
21
|
+
if (!otherArgs.local) await getCustomizationFiles(repo);
|
|
22
|
+
await applyCustomization(repo);
|
|
23
|
+
|
|
24
|
+
console.log( colors.green("\nDone"), "\nCheck changes to your git working tree and try:" );
|
|
25
|
+
console.log( "\tcob-cli test\n" );
|
|
26
|
+
} catch (err) {
|
|
27
|
+
console.error("\n", err.message);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
module.exports = customize;
|
|
31
|
+
/* ************************************************************************ */
|
|
32
|
+
|
|
33
|
+
async function getCustomizationRepo(arg,otherArgs) {
|
|
34
|
+
// Get list of relevant customizations
|
|
35
|
+
let customizationNameQuery = "customize. " + (arg ? arg : "");
|
|
36
|
+
let response = await axios.get(
|
|
37
|
+
"https://api.github.com/search/repositories?q=" +
|
|
38
|
+
customizationNameQuery + "+in:name+org:cob",
|
|
39
|
+
{ headers: { Accept: "application/json", "Accept-Encoding": "identity" } }
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
if (response.data.items.length == 0)
|
|
43
|
+
throw new Error("\nError: ".red + " no customization found\n");
|
|
44
|
+
|
|
45
|
+
// Asks for customization to apply
|
|
46
|
+
const customizationRepos = response.data.items;
|
|
47
|
+
|
|
48
|
+
if(otherArgs.cache) {
|
|
49
|
+
console.log("Caching all customizations...");
|
|
50
|
+
for( let repo of customizationRepos) {
|
|
51
|
+
await getCustomizationFiles(repo);
|
|
38
52
|
}
|
|
39
|
-
|
|
53
|
+
}
|
|
54
|
+
|
|
40
55
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
56
|
+
let answer = await inquirer.prompt([
|
|
57
|
+
{
|
|
58
|
+
type: "list",
|
|
59
|
+
name: "customization",
|
|
60
|
+
message: "What customization do you want to apply?",
|
|
61
|
+
choices: customizationRepos.map((repo) => repo.name).sort(),
|
|
62
|
+
},
|
|
63
|
+
]);
|
|
64
|
+
|
|
65
|
+
//Return the full repo info
|
|
66
|
+
return customizationRepos.find((repo) => repo.name == answer.customization);
|
|
67
|
+
}
|
|
44
68
|
|
|
45
|
-
|
|
46
|
-
|
|
69
|
+
async function getCustomizationFiles(repo) {
|
|
70
|
+
const { xdgData } = await import("xdg-basedir");
|
|
71
|
+
const baseDir = process.cwd();
|
|
72
|
+
const cacheDir = path.resolve(xdgData,"cob-cli")
|
|
73
|
+
if (!fs.existsSync(cacheDir)) fs.mkdirSync(cacheDir, { recursive: true });
|
|
47
74
|
|
|
48
|
-
|
|
49
|
-
|
|
75
|
+
process.chdir(cacheDir);
|
|
76
|
+
if (!fs.existsSync(path.resolve(cacheDir,repo.name))) {
|
|
77
|
+
console.log("git clone" + repo.ssh_url);
|
|
78
|
+
await git().clone(repo.ssh_url);
|
|
79
|
+
} else {
|
|
80
|
+
console.log("git pull " + repo.ssh_url);
|
|
81
|
+
process.chdir(repo.name);
|
|
82
|
+
await git().pull();
|
|
50
83
|
}
|
|
84
|
+
process.chdir(baseDir);
|
|
51
85
|
}
|
|
52
|
-
module.exports = customize;
|
|
53
86
|
|
|
54
|
-
|
|
87
|
+
async function applyCustomization(repo) {
|
|
88
|
+
console.log("\nApplying " + repo.name + " customization ...");
|
|
89
|
+
|
|
90
|
+
// Get customization info from convention defined file (customize.js)
|
|
91
|
+
const { xdgData } = await import("xdg-basedir");
|
|
92
|
+
const customizationFile = path.resolve( xdgData, "cob-cli", repo.name, "customize.js");
|
|
93
|
+
if (!fs.existsSync(customizationFile))
|
|
94
|
+
throw new Error("\nError: ".red + " no customize.js file found\n");
|
|
55
95
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
})
|
|
63
|
-
} else if(option.customization) {
|
|
64
|
-
// Final customization options HAVE a 'customization' function, that process the answers, and HAVE one or more questions
|
|
65
|
-
return inquirer.prompt(option.questions).then( async (answers) => {
|
|
66
|
-
let version = await option.customization(answers) || require('../../package.json').version
|
|
67
|
-
updateCustomizationsVersions(option.short, version)
|
|
68
|
-
})
|
|
96
|
+
let customization = (await import(customizationFile)).default;
|
|
97
|
+
|
|
98
|
+
// Asks options, if configuration exists
|
|
99
|
+
let options = {};
|
|
100
|
+
if (customization.questions) {
|
|
101
|
+
options = await inquirer.prompt(customization.questions);
|
|
69
102
|
}
|
|
70
103
|
|
|
71
|
-
|
|
104
|
+
// Apply specific customization, if it exists, otherwise use default actions
|
|
105
|
+
if (customization.actions) {
|
|
106
|
+
customization.actions(repo.name, options, copy, mergeFiles);
|
|
107
|
+
} else {
|
|
108
|
+
// Default actions
|
|
109
|
+
await copy(path.resolve(xdgData, "cob-cli", repo.name), "./");
|
|
110
|
+
await mergeFiles(repo.name);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Update customizations.json file
|
|
114
|
+
updateCustomizationsVersions(repo.name, customization.version);
|
|
72
115
|
}
|
|
73
116
|
|
|
74
|
-
|
|
117
|
+
function copy(source, target, substitutions = {}) {
|
|
118
|
+
// https://www.npmtrends.com/copyfiles-vs-cpx-vs-ncp-vs-npm-build-tools
|
|
119
|
+
// https://www.npmjs.com/package/ncp
|
|
120
|
+
// https://www.npmjs.com/package/copyfiles
|
|
121
|
+
|
|
122
|
+
console.log(" Copying template files to '" + target + "'...");
|
|
123
|
+
|
|
124
|
+
let srcPath = path.resolve(process.cwd(), source);
|
|
125
|
+
// let excludedFiles = RegExp(srcPath + ".*/node_modules/");
|
|
126
|
+
let excludedFiles = RegExp(
|
|
127
|
+
"(" +
|
|
128
|
+
srcPath +
|
|
129
|
+
".*/node_modules/|" +
|
|
130
|
+
srcPath +
|
|
131
|
+
"/\\..*|" +
|
|
132
|
+
srcPath +
|
|
133
|
+
"/customize.js)"
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
return new Promise(async (resolve) => {
|
|
137
|
+
// Source is on cob-cli repo and Destination on the server repo
|
|
138
|
+
await ncp(
|
|
139
|
+
path.resolve(process.cwd(), source),
|
|
140
|
+
target,
|
|
141
|
+
{
|
|
142
|
+
clobber: true,
|
|
143
|
+
filter: (src) => src.match(excludedFiles) == null,
|
|
144
|
+
// TODO: comentado porque não funciona a copiar os ficheiros binários (em concreto as font no template/dashboards/dash)
|
|
145
|
+
// transform(read, write) {
|
|
146
|
+
// const replaceVars = new Transform({
|
|
147
|
+
// transform: (chunk, encoding, done) => done(null,chunk.toString().replace(/__.+__/g, m => substitutions[m]))
|
|
148
|
+
// })
|
|
149
|
+
// read.pipe(replaceVars).pipe(write)
|
|
150
|
+
// }
|
|
151
|
+
},
|
|
152
|
+
(error, x) => {
|
|
153
|
+
if (error) {
|
|
154
|
+
// Error is an array of problems
|
|
155
|
+
resolve(error.map((e) => e.message).join("\n"));
|
|
156
|
+
} else {
|
|
157
|
+
resolve();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
const files = await fg(["**/*.__*__.*"], { onlyFiles: true, dot: true });
|
|
163
|
+
files.forEach((file) => {
|
|
164
|
+
if (file.match(/__MERGE__/)) return;
|
|
165
|
+
fs.renameSync(
|
|
166
|
+
file,
|
|
167
|
+
file.replace(/__.+__/g, (m) => substitutions[m])
|
|
168
|
+
);
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
async function mergeFiles(block) {
|
|
174
|
+
const mergeFiles = await fg(["**/*.__MERGE__.*"], {
|
|
175
|
+
onlyFiles: false,
|
|
176
|
+
dot: true,
|
|
177
|
+
});
|
|
178
|
+
for (let mergeFile of mergeFiles) {
|
|
179
|
+
let prodFile = mergeFile.replace(/\.__MERGE__/, "");
|
|
180
|
+
let blockMark = block == undefined ? "" : block;
|
|
181
|
+
if (!fs.existsSync(prodFile)) {
|
|
182
|
+
// If prod file does not exist creates it
|
|
183
|
+
console.log(" Creating " + prodFile);
|
|
184
|
+
fs.closeSync(fs.openSync(prodFile, "w"));
|
|
185
|
+
} else {
|
|
186
|
+
console.log(" Merging " + prodFile + " " + block);
|
|
187
|
+
}
|
|
188
|
+
let prodFileContent = fs.readFileSync(prodFile).toString();
|
|
189
|
+
let mergeFileContent = fs.readFileSync(mergeFile).toString();
|
|
190
|
+
let startStr = "/* COB-CLI START " + blockMark + " */\n";
|
|
191
|
+
let endStr = "\n/* COB-CLI END " + blockMark + " */\n";
|
|
192
|
+
|
|
193
|
+
if (prodFileContent.indexOf(startStr) < 0) {
|
|
194
|
+
// If previous customization does not exist
|
|
195
|
+
prodFileContent = startStr + mergeFileContent + endStr + prodFileContent;
|
|
196
|
+
} else {
|
|
197
|
+
// If previous customization exists
|
|
198
|
+
let beforeMerge = prodFileContent.indexOf(startStr);
|
|
199
|
+
let afterMerge = prodFileContent.indexOf(endStr) + endStr.length;
|
|
200
|
+
prodFileContent =
|
|
201
|
+
prodFileContent.substring(0, beforeMerge) +
|
|
202
|
+
startStr +
|
|
203
|
+
mergeFileContent +
|
|
204
|
+
endStr +
|
|
205
|
+
prodFileContent.substring(afterMerge);
|
|
206
|
+
}
|
|
207
|
+
fs.writeFileSync(prodFile, prodFileContent);
|
|
208
|
+
|
|
209
|
+
fs.unlinkSync(mergeFile);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
75
212
|
|
|
76
213
|
function updateCustomizationsVersions(customizationKey, version) {
|
|
77
214
|
const customizationsVersionsFile = "customizations.json";
|
|
78
|
-
let customizationsVersions
|
|
79
|
-
try {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
215
|
+
let customizationsVersions;
|
|
216
|
+
try {
|
|
217
|
+
let customizationsVersionsRawData = fs.readFileSync(
|
|
218
|
+
customizationsVersionsFile
|
|
219
|
+
);
|
|
220
|
+
customizationsVersions = JSON.parse(customizationsVersionsRawData);
|
|
221
|
+
} catch (err) {
|
|
222
|
+
customizationsVersions = {};
|
|
84
223
|
}
|
|
85
224
|
customizationsVersions[customizationKey] = version;
|
|
86
225
|
|
|
87
|
-
fs.writeFile(
|
|
88
|
-
|
|
89
|
-
|
|
226
|
+
fs.writeFile(
|
|
227
|
+
customizationsVersionsFile,
|
|
228
|
+
JSON.stringify(customizationsVersions, null, 2),
|
|
229
|
+
(err) => {
|
|
230
|
+
if (err)
|
|
231
|
+
console.log(
|
|
232
|
+
"Error writing " + customizationsVersionsFile + ":",
|
|
233
|
+
err.message
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
);
|
|
90
237
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cob-cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.26.0",
|
|
4
4
|
"description": "A command line utility to help Cult of Bits partners develop with higher speed and reusing common code and best practices.",
|
|
5
5
|
"preferGlobal": true,
|
|
6
6
|
"repository": {
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"webpack": "^5.49.0",
|
|
32
32
|
"webpack-cli": "^3.3.12",
|
|
33
33
|
"webpack-dev-server": "^3.11.2",
|
|
34
|
-
"whoami": "0.0.3"
|
|
34
|
+
"whoami": "0.0.3",
|
|
35
|
+
"xdg-basedir": "^5.1.0"
|
|
35
36
|
},
|
|
36
37
|
"keywords": [],
|
|
37
38
|
"author": "mimes70",
|
package/.vscode/launch.json
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Use IntelliSense to learn about possible attributes.
|
|
3
|
-
// Hover to view descriptions of existing attributes.
|
|
4
|
-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
-
"version": "0.2.0",
|
|
6
|
-
"configurations": [
|
|
7
|
-
{
|
|
8
|
-
"type": "node",
|
|
9
|
-
"request": "launch",
|
|
10
|
-
"name": "semantic test",
|
|
11
|
-
"skipFiles": [
|
|
12
|
-
"<node_internals>/**"
|
|
13
|
-
],
|
|
14
|
-
//cwd é necessário para correr o debuger na directoria ../server_mimes8
|
|
15
|
-
//AVISO: isto significa que o resultado do comando vai ser na directoria pai de onde este código estiver
|
|
16
|
-
"cwd": "${workspaceFolder}/../server_icad2",
|
|
17
|
-
"program": "${workspaceFolder}/../xpto/app.js",
|
|
18
|
-
"console": "integratedTerminal",
|
|
19
|
-
"args": [
|
|
20
|
-
"test"
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"type": "node",
|
|
25
|
-
"request": "launch",
|
|
26
|
-
"name": "cd server_mimes8; cob-cli test",
|
|
27
|
-
"skipFiles": [
|
|
28
|
-
"<node_internals>/**"
|
|
29
|
-
],
|
|
30
|
-
//cwd é necessário para correr o debuger na directoria ../server_mimes8
|
|
31
|
-
//AVISO: isto significa que o resultado do comando vai ser na directoria pai de onde este código estiver
|
|
32
|
-
"cwd": "${workspaceRoot}/../server_mimes8",
|
|
33
|
-
"program": "${workspaceFolder}/bin/cob-cli.js",
|
|
34
|
-
"console": "integratedTerminal",
|
|
35
|
-
"args": ["test"],
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"type": "node",
|
|
39
|
-
"request": "launch",
|
|
40
|
-
"name": "cd server_mdados; cob-cli test -d escolher_empresa",
|
|
41
|
-
"console": "integratedTerminal",
|
|
42
|
-
"skipFiles": [
|
|
43
|
-
"<node_internals>/**"
|
|
44
|
-
],
|
|
45
|
-
//cwd é necessário para correr o debuger na directoria ../server_mimes8
|
|
46
|
-
//AVISO: isto significa que o resultado do comando vai ser na directoria pai de onde este código estiver
|
|
47
|
-
"cwd": "${workspaceRoot}/../server_mdados",
|
|
48
|
-
"program": "${workspaceFolder}/bin/cob-cli.js",
|
|
49
|
-
"args": ["test", "-d", "escolher_empresa"],
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"type": "node",
|
|
53
|
-
"request": "launch",
|
|
54
|
-
"name": "cd server_mdados; cob-cli deploy",
|
|
55
|
-
"console": "integratedTerminal",
|
|
56
|
-
"skipFiles": [
|
|
57
|
-
"<node_internals>/**"
|
|
58
|
-
],
|
|
59
|
-
//cwd é necessário para correr o debuger na directoria ../server_mimes8
|
|
60
|
-
//AVISO: isto significa que o resultado do comando vai ser na directoria pai de onde este código estiver
|
|
61
|
-
"cwd": "${workspaceRoot}/../server_mdados",
|
|
62
|
-
"program": "${workspaceFolder}/bin/cob-cli.js",
|
|
63
|
-
"args": ["deploy"],
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"type": "node",
|
|
67
|
-
"request": "launch",
|
|
68
|
-
"name": "cd server_icad; cob-cli deploy -s icad",
|
|
69
|
-
"console": "integratedTerminal",
|
|
70
|
-
"skipFiles": [
|
|
71
|
-
"<node_internals>/**"
|
|
72
|
-
],
|
|
73
|
-
"cwd": "${workspaceRoot}/../server_icad",
|
|
74
|
-
"program": "${workspaceFolder}/bin/cob-cli.js",
|
|
75
|
-
"args": ["deploy","-s","icad"],
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"type": "node",
|
|
79
|
-
"request": "launch",
|
|
80
|
-
"name": "cob-cli init mdados",
|
|
81
|
-
"console": "integratedTerminal",
|
|
82
|
-
"skipFiles": [
|
|
83
|
-
"<node_internals>/**"
|
|
84
|
-
],
|
|
85
|
-
//cwd é necessário para correr o debuger na directoria ../
|
|
86
|
-
//AVISO: isto significa que o resultado do comando vai ser na directoria pai de onde este código estiver
|
|
87
|
-
"cwd": "${workspaceRoot}/..",
|
|
88
|
-
"program": "${workspaceFolder}/bin/cob-cli.js",
|
|
89
|
-
"args": ["init","mdados"],
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"type": "node",
|
|
93
|
-
"request": "launch",
|
|
94
|
-
"name": "cob-cli init dogfooding -l CoB/dogfooding",
|
|
95
|
-
"console": "integratedTerminal",
|
|
96
|
-
"skipFiles": [
|
|
97
|
-
"<node_internals>/**"
|
|
98
|
-
],
|
|
99
|
-
//cwd é necessário para correr o debuger na directoria ../
|
|
100
|
-
//AVISO: isto significa que o resultado do comando vai ser na directoria pai de onde este código estiver
|
|
101
|
-
"cwd": "${workspaceRoot}/..",
|
|
102
|
-
"program": "${workspaceFolder}/bin/cob-cli.js",
|
|
103
|
-
"args": ["init","dogfooding","-l","CoB/dogfooding"],
|
|
104
|
-
}
|
|
105
|
-
]
|
|
106
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
exports.option = {
|
|
2
|
-
name: 'Send an email after something happens (https://learning.cultofbits.com)',
|
|
3
|
-
short: "Send Email",
|
|
4
|
-
questions: [
|
|
5
|
-
require("../lib/task_lists/customize_questions").dashboardNameQuestion
|
|
6
|
-
],
|
|
7
|
-
customization: function (answers) {
|
|
8
|
-
console.log("TODO - SendEmail:" + JSON.stringify(answers, null, ' '));
|
|
9
|
-
}
|
|
10
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
exports.option = {
|
|
2
|
-
name: 'Backend - Add a server event based behaviour (https://learning.cultofbits.com)',
|
|
3
|
-
short: "Backend",
|
|
4
|
-
followUp: [ {
|
|
5
|
-
type: 'list',
|
|
6
|
-
name: 'choosenFollowUp',
|
|
7
|
-
message: 'Select one?',
|
|
8
|
-
choices: [
|
|
9
|
-
require("./backend.vuepress").option,
|
|
10
|
-
require("./backend.email").option,
|
|
11
|
-
require("./backend.updateField").option
|
|
12
|
-
]}
|
|
13
|
-
]
|
|
14
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
exports.option = {
|
|
2
|
-
name: 'Update a field (https://learning.cultofbits.com)',
|
|
3
|
-
short: "Update",
|
|
4
|
-
questions: [
|
|
5
|
-
require("../lib/task_lists/customize_questions").dashboardNameQuestion,
|
|
6
|
-
require("../lib/task_lists/customize_questions").dashboardNameQuestion2
|
|
7
|
-
],
|
|
8
|
-
customization: function (answers) {
|
|
9
|
-
console.log("TODO - updateField:" + JSON.stringify(answers, null, ' '));
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
exports.option = {
|
|
2
|
-
name: 'Vuepress - Recordm based CMS ',
|
|
3
|
-
short: "Dash",
|
|
4
|
-
questions: [
|
|
5
|
-
],
|
|
6
|
-
customization: async function (answers) {
|
|
7
|
-
const { copy } = require("../lib/task_lists/customize_copy");
|
|
8
|
-
await copy("../../templates/backend/vuepress/others/vuepress/","./others/vuepress/")
|
|
9
|
-
await copy("../../templates/backend/vuepress/integrationm/actions/","./integrationm/actions/")
|
|
10
|
-
//TODO: ln -s /opt/others/vuepress/nginx/dist/ /usr/share/nginx/html/docs
|
|
11
|
-
//TODO: create/update definition (original na learning)
|
|
12
|
-
//TODO: create/update permissions
|
|
13
|
-
//TODO: criar instância .site. e .site.home.
|
|
14
|
-
//TODO: perguntar id da definição de conteúdo e substituir onde necessário (actions e References.vue e graph.vue)
|
|
15
|
-
//TODO: deploy (to have content actions)
|
|
16
|
-
//TODO: indicar que é necessário configurar o ./other/vuepress/config.json
|
|
17
|
-
//TODO: indicar que é necessário configurar o ./other/vuepress/config.js
|
|
18
|
-
//TODO: build
|
|
19
|
-
//TODO: deploy
|
|
20
|
-
/*
|
|
21
|
-
Sequência:
|
|
22
|
-
1. cob-cli customize backend.vuepress
|
|
23
|
-
2. git add .; git commit -m “chore: cob-cli customize backend.vuepress"
|
|
24
|
-
2. cob-cli deploy
|
|
25
|
-
2. ln -s /opt/others/vuepress/nginx/dist/ /usr/share/nginx/html/docs (na máquina)
|
|
26
|
-
3. install Contents definition
|
|
27
|
-
4. add permissions
|
|
28
|
-
5. config server.json
|
|
29
|
-
6. create contents:
|
|
30
|
-
.site.
|
|
31
|
-
.site.home.
|
|
32
|
-
.site.home.sitemap
|
|
33
|
-
*/
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
exports.option = {
|
|
2
|
-
name: 'Dash - Dynamic Dashboard based on instances from a specific definition',
|
|
3
|
-
short: "Dash",
|
|
4
|
-
questions: [
|
|
5
|
-
],
|
|
6
|
-
customization: async function (answers) {
|
|
7
|
-
console.log("\nApplying Dash keyword customizations ...")
|
|
8
|
-
|
|
9
|
-
const { copy } = require("../lib/task_lists/customize_copy");
|
|
10
|
-
const target = "./recordm/customUI/dash/"
|
|
11
|
-
await copy("../../templates/dashboards/dash/",target)
|
|
12
|
-
return require("../templates/dashboards/dash/package.json").version
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
exports.option = {
|
|
2
|
-
name: 'Dashboards - Create or change dashboards (https://learning.cultofbits.com)',
|
|
3
|
-
short: "Dashboards",
|
|
4
|
-
followUp: [ {
|
|
5
|
-
type: 'list',
|
|
6
|
-
name: 'choosenFollowUp',
|
|
7
|
-
message: 'Which type of dashboard?',
|
|
8
|
-
choices: [
|
|
9
|
-
require("./dashboard.dash").option,
|
|
10
|
-
require("./dashboard.simple").option,
|
|
11
|
-
require("./dashboard.vue").option
|
|
12
|
-
]}
|
|
13
|
-
]
|
|
14
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
exports.option = {
|
|
2
|
-
name: 'Simple - Just HTML code and cob libs',
|
|
3
|
-
short: "Simple",
|
|
4
|
-
questions: [
|
|
5
|
-
require("../lib/task_lists/customize_questions").dashboardNameQuestion
|
|
6
|
-
],
|
|
7
|
-
customization: function (answers) {
|
|
8
|
-
const { copy } = require("../lib/task_lists/customize_copy");
|
|
9
|
-
const target = "./recordm/customUI/"+answers.name+".html"
|
|
10
|
-
return copy("../../templates/dashboards/cob-dashboard-html/demoDashboard.html",target)
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
exports.option = {
|
|
2
|
-
name: 'Simple - basic files to start from scratch',
|
|
3
|
-
short: "Simple",
|
|
4
|
-
questions: [
|
|
5
|
-
require("../lib/task_lists/customize_questions").dashboardNameQuestion
|
|
6
|
-
],
|
|
7
|
-
customization: function (answers) {
|
|
8
|
-
const { copy } = require("../lib/task_lists/customize_copy");
|
|
9
|
-
const target = "./recordm/customUI/"+answers.name+"/"
|
|
10
|
-
return copy("../../templates/dashboard/cob-dashboard-vue/",target)
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
exports.option = {
|
|
2
|
-
name: "Grid - simple grid structure",
|
|
3
|
-
short: "Grid",
|
|
4
|
-
questions: [
|
|
5
|
-
require("../lib/task_lists/customize_questions").dashboardNameQuestion
|
|
6
|
-
],
|
|
7
|
-
customization: function (answers) {
|
|
8
|
-
console.log("TODO - vueGrid:" + JSON.stringify(answers, null, ' '));
|
|
9
|
-
}
|
|
10
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
exports.option = {
|
|
2
|
-
name: 'Vue - Vue + Vuetify + cob libs',
|
|
3
|
-
short: "Vue",
|
|
4
|
-
followUp: [ {
|
|
5
|
-
type: 'list',
|
|
6
|
-
name: 'choosenFollowUp',
|
|
7
|
-
message: 'Which template do you want to start with?',
|
|
8
|
-
choices: [
|
|
9
|
-
require("./dashboard.vue.empty").option,
|
|
10
|
-
require("./dashboard.vue.grid").option,
|
|
11
|
-
require("./dashboard.vue.menuAndGrid").option,
|
|
12
|
-
]}
|
|
13
|
-
]
|
|
14
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
exports.option = {
|
|
2
|
-
name: "Menu+Grid - menu column and simple grid structure",
|
|
3
|
-
short: "GrMenu+Gridid",
|
|
4
|
-
questions: [
|
|
5
|
-
require("../lib/task_lists/customize_questions").dashboardNameQuestion
|
|
6
|
-
],
|
|
7
|
-
customization: function (answers) {
|
|
8
|
-
console.log("TODO - vueMenuGrid:" + JSON.stringify(answers, null, ' '));
|
|
9
|
-
}
|
|
10
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
exports.option = {
|
|
2
|
-
name: 'Common - Typical frontend customizations (https://learning.cultofbits.com)',
|
|
3
|
-
short: "Common",
|
|
4
|
-
questions: [
|
|
5
|
-
],
|
|
6
|
-
customization: async function (answers) {
|
|
7
|
-
console.log("\nApplying common frontend customizations ...")
|
|
8
|
-
|
|
9
|
-
const { copy } = require("../lib/task_lists/customize_copy");
|
|
10
|
-
const { mergeFiles } = require("../lib/task_lists/customize_mergeFiles");
|
|
11
|
-
const target = "./recordm/customUI/"
|
|
12
|
-
await copy("../../templates/frontend/common/",target)
|
|
13
|
-
await mergeFiles("Frontend.Common")
|
|
14
|
-
return require("../templates/frontend/common/package.json").version
|
|
15
|
-
}
|
|
16
|
-
}
|