cob-cli 2.11.0 → 2.13.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.
Files changed (84) hide show
  1. package/README.publish.md +10 -0
  2. package/customizations/backend.js +1 -0
  3. package/customizations/backend.vuepress.js +35 -0
  4. package/customizations/frontend.js +1 -0
  5. package/lib/task_lists/rsyncFilter.txt +2 -1
  6. package/lib/task_lists/test_otherFilesContiousReload.js +1 -1
  7. package/package.json +5 -1
  8. package/templates/backend/vuepress/integrationm/actions/getVuePressDoc.groovy +74 -0
  9. package/templates/backend/vuepress/integrationm/actions/getVuePressSidebarConfig.groovy +42 -0
  10. package/templates/backend/vuepress/integrationm/actions/getVuePressSidebarRootElements.groovy +17 -0
  11. package/templates/backend/vuepress/others/vuepress/definition_contents_v234.json +619 -0
  12. package/templates/backend/vuepress/others/vuepress/nginx/README.md +28 -0
  13. package/templates/backend/vuepress/others/vuepress/package-lock.json +29656 -0
  14. package/templates/backend/vuepress/others/vuepress/package.json +24 -0
  15. package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/DescriptVideo.vue +22 -0
  16. package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/Graph.vue +124 -0
  17. package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/ReadingTime.vue +26 -0
  18. package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/References.vue +228 -0
  19. package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/RestrictedContent.vue +77 -0
  20. package/templates/backend/vuepress/others/vuepress/src/.vuepress/config.js +101 -0
  21. package/templates/backend/vuepress/others/vuepress/src/.vuepress/config.json +31 -0
  22. package/templates/backend/vuepress/others/vuepress/src/.vuepress/enhanceApp.js +14 -0
  23. package/templates/backend/vuepress/others/vuepress/src/.vuepress/nav/getNavTranslated.js +52 -0
  24. package/templates/backend/vuepress/others/vuepress/src/.vuepress/plugins/References.js +96 -0
  25. package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/Logo-Cult-of-Bits-400x400-1.png +0 -0
  26. package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/favicon-cob.png +0 -0
  27. package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/logo.png +0 -0
  28. package/templates/backend/vuepress/others/vuepress/src/.vuepress/styles/index.styl +39 -0
  29. package/templates/backend/vuepress/others/vuepress/src/.vuepress/styles/palette.styl +17 -0
  30. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/LICENSE +21 -0
  31. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/README.md +11 -0
  32. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/AlgoliaSearchBox.vue +172 -0
  33. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/DropdownLink.vue +252 -0
  34. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/DropdownTransition.vue +33 -0
  35. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Home.vue +134 -0
  36. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/NavLink.vue +98 -0
  37. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/NavLinks.vue +165 -0
  38. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Navbar.vue +140 -0
  39. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Page.vue +31 -0
  40. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/PageEdit.vue +119 -0
  41. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/PageNav.vue +163 -0
  42. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Sidebar.vue +64 -0
  43. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarButton.vue +40 -0
  44. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarGroup.vue +144 -0
  45. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarLink.vue +140 -0
  46. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarLinks.vue +114 -0
  47. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/Badge.vue +44 -0
  48. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/CodeBlock.vue +41 -0
  49. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/CodeGroup.vue +120 -0
  50. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/index.js +59 -0
  51. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/layouts/404.vue +30 -0
  52. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/layouts/Layout.vue +151 -0
  53. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/noopModule.js +1 -0
  54. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/package.json +44 -0
  55. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/arrow.styl +22 -0
  56. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/code.styl +137 -0
  57. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/config.styl +1 -0
  58. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/custom-blocks.styl +44 -0
  59. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/index.styl +202 -0
  60. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/mobile.styl +37 -0
  61. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/toc.styl +3 -0
  62. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/wrapper.styl +10 -0
  63. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/util/index.js +244 -0
  64. package/templates/dashboards/dash/definition_dashboard_v59.json +1 -0
  65. package/templates/dashboards/dash/dist/css/app.2ca409ad.css +8 -0
  66. package/templates/dashboards/dash/dist/dashboard.html +10 -5
  67. package/templates/dashboards/dash/dist/js/{app.a65a4c2c.js → app.8423eff3.js} +2 -2
  68. package/templates/dashboards/dash/dist/js/app.8423eff3.js.map +1 -0
  69. package/templates/dashboards/dash/dist/js/app.f9c19b80.js +188 -0
  70. package/templates/dashboards/dash/dist/js/app.f9c19b80.js.map +1 -0
  71. package/templates/dashboards/dash/src/App.vue +32 -212
  72. package/templates/dashboards/dash/src/Dashboard.vue +31 -11
  73. package/templates/dashboards/dash/src/collector.js +35 -3694
  74. package/templates/dashboards/dash/src/components/Menu.vue +15 -4
  75. package/templates/dashboards/dash/src/components/Title.vue +10 -2
  76. package/templates/dashboards/dash/src/components/Totals.vue +19 -9
  77. package/templates/dashboards/dash/src/components/{TotalsBadge.vue → TotalsValue.vue} +12 -12
  78. package/templates/dashboards/dash/src/dashboard.html +6 -1
  79. package/templates/dashboards/dash/src/definition_dashboard_v59.json +394 -0
  80. package/templates/dashboards/dash/src/output.css +90228 -90
  81. package/templates/dashboards/dash/src/test_collector.js +3732 -0
  82. package/templates/dashboards/dash/tailwind.config.js +1 -0
  83. package/templates/dashboards/dash/dist/css/app.3140d0d1.css +0 -8
  84. package/templates/dashboards/dash/dist/js/app.a65a4c2c.js.map +0 -1
@@ -0,0 +1,10 @@
1
+ Para avançar a versão e publicar:
2
+
3
+ `npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]`
4
+
5
+ Exemplo:
6
+ ```
7
+ npm version patch
8
+ git push
9
+ npm publish
10
+ ```
@@ -6,6 +6,7 @@ exports.option = {
6
6
  name: 'choosenFollowUp',
7
7
  message: 'Select one?',
8
8
  choices: [
9
+ require("./backend.vuepress").option,
9
10
  require("./backend.email").option,
10
11
  require("./backend.updateField").option
11
12
  ]}
@@ -0,0 +1,35 @@
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
+ }
@@ -7,6 +7,7 @@ exports.option = {
7
7
  message: 'Select one?',
8
8
  choices: [
9
9
  require("./frontend.common").option,
10
+ require("./frontend.easy").option,
10
11
  require("./frontend.formatList").option
11
12
  ]}
12
13
  ]
@@ -3,6 +3,7 @@
3
3
  + /services/com.cultofbits.integrationm.service.properties
4
4
  - /services/**
5
5
 
6
+ + /security/password.rules.properties
6
7
  - /security
7
8
  - /hornetq
8
9
  - /elasticsearch
@@ -28,4 +29,4 @@
28
29
  - .env.json
29
30
  - .idea
30
31
 
31
- - **.ENV__*__.*
32
+ - **.ENV__*__.*
@@ -32,7 +32,7 @@ async function otherFilesContiousReload(cmdEnv) {
32
32
  let stash = true;
33
33
  await git().env('LC_ALL', 'C').stash(["--include-untracked"]).then( value => value.indexOf("Saved") == 0 || (stash = false))
34
34
  let lastSha = await getLastDeployedSha(cmdEnv.server)
35
- git().checkout(lastSha)
35
+ await git().checkout(lastSha)
36
36
 
37
37
  await cmdEnv.applyLastEnvironmentDeployedToServerChanges()
38
38
  for(let changedFile of changedFiles) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cob-cli",
3
- "version": "2.11.0",
3
+ "version": "2.13.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": {
@@ -8,6 +8,10 @@
8
8
  "url": "git@github.com:cob/cob-cli.git"
9
9
  },
10
10
  "main": "./bin/cob-cli.js",
11
+ "scripts": {
12
+ "postinstall": "bin/cob-cli.js --setup",
13
+ "uninstall": "bin/cob-cli.js --cleanup"
14
+ },
11
15
  "bin": {
12
16
  "cob-cli": "bin/cob-cli.js"
13
17
  },
@@ -0,0 +1,74 @@
1
+ import groovy.transform.Field;
2
+ import org.apache.commons.logging.*;
3
+
4
+ import static utils.CobUtils.*;
5
+ import groovy.json.JsonOutput
6
+
7
+
8
+ @Field log = LogFactory.getLog(getClass());
9
+ log.info("Building VuePress e-learning content part")
10
+ return JsonOutput.prettyPrint(JsonOutput.toJson( getVuePressDocs() ))
11
+
12
+ /********************************************************************************************/
13
+
14
+ def getVuePressDocs() {
15
+ def docs = [];
16
+
17
+ def contents = registosPaginadosAsMap(66,"*", actionPacks.get("rmRest"), "sortablefield", true)
18
+ contents.each { content ->
19
+ def langs = ["","pt","es"]
20
+ def contentLink = content["path"][0]
21
+ if( contentLink == "/site/home/" ) contentLink = "/";
22
+
23
+ if(!content["type"] || content["type"][0] == "SiteItem" && content["siteitemtype"][0] == "directory" ) return // No page for directories
24
+
25
+ langs.each { lang ->
26
+ def langPostfix = lang ? "-" + lang : ""
27
+ def contentMD = content["content"+langPostfix] ? content["content"+langPostfix][0] : content["content"] ? content["content"][0] : content["content-pt"] ? content["content-pt"][0] : content["content-es"] ? content["content-es"][0] : "";
28
+
29
+ contentMD = addToFrontmatter(contentMD, "id: " + content.id)
30
+
31
+ def isSitePath = contentLink =~ /^\/site\/([^\/]*)s\//
32
+ def isSolutionPath = contentLink =~ /^\/solutions\//
33
+ if( isSolutionPath ) {
34
+ contentMD = addToFrontmatter(contentMD, "target: Solution")
35
+ } else if( isSitePath ) {
36
+ // If the content link starts with /site/ then use the next path part as the type. This will enable NavBar activeLink.
37
+ // Notice we expect Types to be in the singular so we remove the 's' from the match on the type
38
+ contentMD = addToFrontmatter(contentMD, "target: " + isSitePath[0][1])
39
+ } else {
40
+ def target = ""
41
+ if(content && content["target"]) target = content["target"][0]
42
+ contentMD = addToFrontmatter(contentMD, "target: " + target)
43
+ }
44
+
45
+ if(content["visibility"][0] != "Public") {
46
+ contentMD = getJustFrontmatter(contentMD) + "<RestrictedContent/>"
47
+ }
48
+
49
+ def langPath = lang ? "/" + lang : ""
50
+ docs.push(["path": langPath + contentLink, "content": contentMD])
51
+ }
52
+ }
53
+ return docs
54
+ }
55
+
56
+ def addToFrontmatter(content,expression) {
57
+ // Acrescentado um \n à avaliação do conteúdo para compensar o caso em que,
58
+ // quando só há frontmatter no conteúdo, o RM remove os trailing \n
59
+ // (terminando o conteúdo em --- e por isso depois não fazia match no split)
60
+ def frontmatterEval = (content+"\n")?.split("---")
61
+ if(frontmatterEval?.size()>2) {
62
+ frontmatterEval[1] += expression + "\n"
63
+ content = frontmatterEval.join("---\n")
64
+ } else {
65
+ content = "---\n" + expression + "\n---\n" + content
66
+ }
67
+ return content
68
+ }
69
+
70
+ def getJustFrontmatter(content) {
71
+ def splitContent = content?.split("---\n")
72
+ if(splitContent?.size()<=2) return ""
73
+ return splitContent[0..1].join("---\n") + "---\n"
74
+ }
@@ -0,0 +1,42 @@
1
+ import groovy.transform.Field;
2
+ import org.apache.commons.logging.*;
3
+
4
+ import static utils.CobUtils.*;
5
+ import groovy.json.JsonOutput
6
+
7
+
8
+ @Field log = LogFactory.getLog(getClass());
9
+ log.info("Building VuePress e-learning sidebar...")
10
+
11
+ def path = argsMap.path ;
12
+ def lang = (!argsMap.lang || argsMap.lang == "en") ? "" : argsMap.lang ;
13
+ def sidebarConfig = getVuePressSidebarConfig(path, lang, true)
14
+ return JsonOutput.prettyPrint(JsonOutput.toJson( sidebarConfig ))
15
+
16
+
17
+ /********************************************************************************************/
18
+
19
+ def getVuePressSidebarConfig(path, lang, isRoot) {
20
+ def sidebar = [];
21
+ def pathField = isRoot ? "path.raw" : "parent_path.raw"; // no caso dos conteúdos de topo é necessário processar o próprio primeiro e depois os seus filhos
22
+ def contents = registosPaginadosAsMap(66, pathField+":\""+path+"\"", actionPacks.get("rmRest"), "sortablefield", true)
23
+
24
+ contents.each { content ->
25
+ def node = [:]
26
+ def nameSufixForLang = (lang && content["name-"+lang]) ? ("-"+lang) : content["name"] ? "" : content["name-pt"] ? "-pt" : "-es" ; // sufix shoud be the one specified in lang, unless it's content does not exist and, in that case, it will defaul to EN, then PT, then ES
27
+ def pathForLang = (lang ? "/" + lang : "") + content["path"][0]
28
+ def titleForLang = content["name"+nameSufixForLang][0]
29
+
30
+ def children = getVuePressSidebarConfig(content["path"][0], lang, false)
31
+ if(children.size == 0) {
32
+ node = [ pathForLang, titleForLang ]
33
+ } else {
34
+ node["title"] = titleForLang
35
+ node["path"] = pathForLang
36
+ node["children"] = [ pathForLang, *children ] // o truque de ter um grupo com conteúdo está em adicionar o próprio como filho mas depois esconder no html e mostrar o link do grupo com estilo de conteúdo normal
37
+ node["sidebarDepth"] = isRoot ? 1 : 0
38
+ }
39
+ sidebar.push(node)
40
+ }
41
+ return sidebar
42
+ }
@@ -0,0 +1,17 @@
1
+
2
+ import static utils.CobUtils.*;
3
+ import groovy.json.JsonOutput
4
+
5
+ return JsonOutput.prettyPrint(JsonOutput.toJson( getVuePressSidebarRootElements() ))
6
+
7
+ /********************************************************************************************/
8
+
9
+ def getVuePressSidebarRootElements() {
10
+ def sidebarRootElements = [];
11
+
12
+ def contents = registosPaginadosAsMap(66, "format.raw:Book", actionPacks.get("rmRest"), "sortablefield", true)
13
+ contents.each { content ->
14
+ sidebarRootElements.push(content["path"][0])
15
+ }
16
+ return sidebarRootElements
17
+ }