autoforce 0.1.8 → 0.1.10

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 (56) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +6 -3
  3. package/commands/modelA/tasks/list.json +11 -0
  4. package/commands/modelA/tasks/start.json +2 -2
  5. package/commands/modelA/tasks/view.json +1 -0
  6. package/commands/modelC/new/issue.json +41 -0
  7. package/commands/modelC/subtasks/checkout-branch.json +60 -0
  8. package/commands/modelC/subtasks/create-pull.json +20 -0
  9. package/commands/modelC/subtasks/pack.json +29 -0
  10. package/commands/modelC/subtasks/publish-branch.json +20 -0
  11. package/commands/modelC/tasks/cancel.json +6 -0
  12. package/commands/modelC/tasks/finish.json +41 -0
  13. package/commands/modelC/tasks/list.json +11 -0
  14. package/commands/modelC/tasks/publish.json +13 -0
  15. package/commands/modelC/tasks/start.json +51 -0
  16. package/commands/modelC/tasks/stop.json +32 -0
  17. package/commands/modelC/tasks/switch.json +53 -0
  18. package/commands/modelC/tasks/view.json +13 -0
  19. package/commands/models.json +18 -0
  20. package/lib/auto.js +2 -1
  21. package/lib/helpers/class.js +4 -3
  22. package/lib/helpers/context.d.ts +7 -5
  23. package/lib/helpers/context.js +18 -8
  24. package/lib/helpers/github-graphql.d.ts +2 -5
  25. package/lib/helpers/github-graphql.js +1 -31
  26. package/lib/helpers/github-project-graphql.d.ts +18 -3
  27. package/lib/helpers/github-project-graphql.js +60 -6
  28. package/lib/helpers/gitlab-graphql.d.ts +7 -5
  29. package/lib/helpers/gitlab-graphql.js +13 -3
  30. package/lib/helpers/lwc.js +4 -3
  31. package/lib/helpers/metadata.js +2 -2
  32. package/lib/helpers/object.js +4 -3
  33. package/lib/helpers/taskFunctions.js +24 -3
  34. package/lib/helpers/tasks.js +11 -7
  35. package/lib/helpers/template.d.ts +2 -2
  36. package/lib/helpers/template.js +2 -4
  37. package/lib/helpers/util.d.ts +7 -1
  38. package/lib/helpers/util.js +48 -5
  39. package/package.json +2 -1
  40. package/templates/modelB/changelog.md +4 -0
  41. package/templates/modelB/openIssues.md +0 -0
  42. package/templates/models.json +13 -0
  43. package/templates/story.md +0 -32
  44. package/templates/usecase.md +0 -52
  45. /package/templates/{dictionary → modelA/dictionary}/class-all.md +0 -0
  46. /package/templates/{dictionary → modelA/dictionary}/class-diagrama.md +0 -0
  47. /package/templates/{dictionary → modelA/dictionary}/class-inner.md +0 -0
  48. /package/templates/{dictionary → modelA/dictionary}/class-metodos.md +0 -0
  49. /package/templates/{dictionary → modelA/dictionary}/class-public.md +0 -0
  50. /package/templates/{dictionary → modelA/dictionary}/class-referencias.md +0 -0
  51. /package/templates/{dictionary → modelA/dictionary}/class.md +0 -0
  52. /package/templates/{dictionary → modelA/dictionary}/classes.md +0 -0
  53. /package/templates/{dictionary → modelA/dictionary}/object.md +0 -0
  54. /package/templates/{dictionary → modelA/dictionary}/objects.md +0 -0
  55. /package/templates/{intro.md → modelA/intro.md} +0 -0
  56. /package/templates/{process.md → modelA/process.md} +0 -0
package/CHANGELOG.md CHANGED
@@ -0,0 +1,4 @@
1
+
2
+ Version 0.1.9
3
+ * Comando de new issue para crear un issue nuevo en el backlog
4
+ * Comando de list para ver issues en backlog o ver los detalles de uno
package/README.md CHANGED
@@ -5,8 +5,11 @@ El proyecto esta en Beta todavia, recien fue migrado a Typescript y paso de ser
5
5
 
6
6
  ## Objetivo
7
7
 
8
- La motivacion de crear la herramienta fue facilitar y automatizar las tareas comunes que realizamos los desarrolladores, especialmente los que utilizacion Salesforce.
9
- A medida que pasa el tiempo tenemos cada vez mas herramientas diarias y especificas, pero las tareas en si son las mismas, queremos arrancar a desarrollar algo nuevo (start), terminar el desarrollo(finish), o bien dejarlo a un costado (stop), y posiblemente cancelar por completo alguno (cancel).
8
+ La motivacion de crear la herramienta fue facilitar y automatizar las tareas comunes que realizamos los desarrolladores, especialmente los que utilizamos Salesforce.
9
+
10
+ Me vi en la necesidad de tener una herramienta porque muchas veces me ganaba la ansiedad y queria hacer varios cambios juntos. Sentia que hacer varios stories, cada una con su branch, y todo el proceso era perder mucho tiempo. Pero cuando uno logra automatizar el repositorio queda mas prolijo y la trazabilidad tambien, y permite que otros desarrolladores puedan colaborar de forma mas simple.
11
+
12
+ En general cuando desarrollamos, repetimos mas o menos las mismas tareas. Arrancamos a desarrollar algo nuevo (start), terminamos ese desarrollo(finish), o bien dejarlo a un costado (stop), y posiblemente lo descartamos por completo (cancel). Dependiendo la tecnologia, el tipo de desarrollo, y que estrategia de branching, entre otras cosas mas, estas tareas podrian ser distintas.
10
13
 
11
14
  En este repo las tareas buscan automatizar o integrar el siguiente tipo gestiones:
12
15
 
@@ -30,7 +33,7 @@ En este repo las tareas buscan automatizar o integrar el siguiente tipo gestione
30
33
 
31
34
  - [Model B] "Desarrollo de Producto": 0%
32
35
 
33
- - [Custom] "Modelo configurado fuera de la herramienta"
36
+ - [Custom] "Modelo personalizado"
34
37
 
35
38
  2. Github Services
36
39
  - Github: Listo
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "list",
3
+ "guards": ["isGitApi"],
4
+ "description": "Comando para ver en detalle el requerimiento",
5
+ "steps": [
6
+ {
7
+ "name": "Ver los issues del Backlog",
8
+ "function": "listIssues"
9
+ }
10
+ ]
11
+ }
@@ -29,7 +29,7 @@
29
29
  "function": "assignIssueToMe",
30
30
  "arguments": ["${newIssueNumber}"],
31
31
  "errorMessage": "No se pudo pudo asignar la branch (${newBranchName}) al issue. Por favor hagalo manualmente",
32
- "skipOnError": true
32
+ "onError": "skip"
33
33
  },
34
34
  {
35
35
  "name": "Pone la branch en el issue",
@@ -39,7 +39,7 @@
39
39
  "issueNumber": "${newIssueNumber}"
40
40
  },
41
41
  "errorMessage": "No se pudo asignar la branch ${newBranchName} al issue ${newIssueNumber}. Hagalo manualmente",
42
- "skipOnError": true
42
+ "onError": "skip"
43
43
  },
44
44
  {
45
45
  "name": "Asocia la branch con el remote",
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "view",
3
3
  "guards": ["isGitApi"],
4
+ "arguments": ["issueNumber"],
4
5
  "description": "Comando para ver en detalle el requerimiento",
5
6
  "steps": [
6
7
  {
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "issue",
3
+ "guards": ["isGitApi"],
4
+ "arguments": {
5
+ "title": { "required": true },
6
+ "label": {
7
+ "type": "select",
8
+ "choices": [
9
+ {
10
+ "title": "Automation",
11
+ "value": "automation",
12
+ "description": "Test cases de automatizacion o cualquier cambio dentro de la automatizacion del pipeline"
13
+ },
14
+ {
15
+ "title": "Bugfix",
16
+ "value": "bug",
17
+ "description": "Correxion de codigo, no hay incremento funcional"
18
+ },
19
+ {
20
+ "title": "Documentation",
21
+ "value": "documentation",
22
+ "description": "Cambios en la documentacion"
23
+ },
24
+ {
25
+ "title": "Feature",
26
+ "value": "feature",
27
+ "description": "Nuevas funcionalidades"
28
+ }
29
+ ]
30
+ },
31
+ "body": { "required": false }
32
+ },
33
+ "description": "Comando para crear un requerimiento nuevo",
34
+ "steps": [
35
+ {
36
+ "name": "Crear un issue nuevo",
37
+ "function": "createIssue",
38
+ "arguments": ["${title}", "${label}", "${body}"]
39
+ }
40
+ ]
41
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "checkout-branch",
3
+ "guards": ["isGitApi"],
4
+ "arguments": ["newBranchName"],
5
+ "description": "Comando para cambiar de branch y baja cualquier cambio que este en la remote branch o en main",
6
+ "steps": [
7
+ {
8
+ "name": "valida que no sea la branch actual",
9
+ "function": "validaNoseaBranchActual",
10
+ "arguments": ["${newBranchName}"],
11
+ "description": "Valida que no sea la branch actual",
12
+ "errorMessage": "Ya esta parado sobre la branch ${newBranchName}"
13
+ },
14
+ {
15
+ "name": "chequea si hay cambios sin commit",
16
+ "function": "checkCommitPending",
17
+ "description": "Chequea si hay algo sin commitear",
18
+ "errorMessage": "Tiene modificaciones pendientes:\n ${salida}",
19
+ "onError": "commitChanges"
20
+ },
21
+ {
22
+ "name": "baja cambios en remote y en main",
23
+ "command": "git",
24
+ "arguments": ["fetch"],
25
+ "description": "Baja de remote",
26
+ "errorMessage": "No se pudo actualizar la branch, intente manualmente con git fetch"
27
+ },
28
+ {
29
+ "criteria": { "field": "existNewBranch", "value": true },
30
+ "name": "cambia de branch",
31
+ "command": "git",
32
+ "arguments": ["checkout", "${newBranchName}"],
33
+ "description": "Cambia de branch",
34
+ "errorMessage": "No se pudo mover al branch ${newBranchName}. Hagalo manualmente ${command}"
35
+ },
36
+ {
37
+ "criteria": { "field": "existNewBranch", "value": true },
38
+ "name": "baja de la remote branch",
39
+ "command": "git",
40
+ "arguments": ["pull", "--set-upstream", "origin ${newBranchName}"],
41
+ "description": "Trae contenido de branch remota",
42
+ "errorMessage": "No se pudo traer de la remote branch ${newBranchName}. Hagalo manualmente ${command}"
43
+ },
44
+ {
45
+ "criteria": { "field": "existNewBranch", "value": true },
46
+ "name": "merge de main",
47
+ "command": "git",
48
+ "arguments": ["merge main"],
49
+ "description": "Trae cualquier cambio en main",
50
+ "errorMessage": "No se pudo actualizar la branch con main, intente manualmente con git merge main"
51
+ },
52
+ {
53
+ "criteria": { "field": "existNewBranch", "value": false },
54
+ "name": "crea de branch",
55
+ "function": "createBranch",
56
+ "description": "Crea la nueva branch ${newBranchName}",
57
+ "errorMessage": "No se pudo crear la branch ${newBranchName}. Hagalo manualmente ${command}"
58
+ }
59
+ ]
60
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "create-pull",
3
+ "guards": ["isGitApi"],
4
+ "description": "Comando para crear el pull request de la branch",
5
+ "steps": [
6
+ {
7
+ "name": "chequea si hay cambios sin commit",
8
+ "function": "checkCommitPending",
9
+ "description": "Chequea si hay algo sin commitear",
10
+ "errorMessage": "Tiene modificaciones pendientes:\n ${salida}",
11
+ "onError": "commitChanges"
12
+ },
13
+ {
14
+ "name": "publica la branch",
15
+ "function": "publishBranch",
16
+ "description": "Publicha la branch en Remote",
17
+ "errorMessage": "No se pudo publicar la branch"
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "pack",
3
+ "description": "Comando para crear el package localmente",
4
+ "steps": [
5
+ {
6
+ "name": "Borra el paquete",
7
+ "command": "rm autoforce*.tgz",
8
+ "onError": "skip"
9
+ },
10
+ {
11
+ "name": "Borra los archivos en Lib",
12
+ "command": "rm -rf ./lib/",
13
+ "onError": "skip"
14
+ },
15
+ {
16
+ "name": "Compila el typescript",
17
+ "command": "tsc --project tsconfig.build.json"
18
+ },
19
+ {
20
+ "name": "Arma el paquete",
21
+ "command": "yarn pack"
22
+ },
23
+ {
24
+ "name": "Renombra paquete",
25
+ "command": "mv autoforce*.tgz autoforce.tgz"
26
+ }
27
+ ]
28
+ }
29
+
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "publish-branch",
3
+ "guards": ["isGitApi"],
4
+ "description": "Comando para publicar la branch en Remote",
5
+ "steps": [
6
+ {
7
+ "name": "chequea si hay cambios sin commit",
8
+ "function": "checkCommitPending",
9
+ "description": "Chequea si hay algo sin commitear",
10
+ "errorMessage": "Tiene modificaciones pendientes:\n ${salida}",
11
+ "onError": "commitChanges"
12
+ },
13
+ {
14
+ "name": "publica la branch",
15
+ "function": "publishBranch",
16
+ "description": "Publicha la branch en Remote",
17
+ "errorMessage": "No se pudo publicar la branch"
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "cancel",
3
+ "guards": ["isGitApi"],
4
+ "description": "Comando para cancelar un requerimiento",
5
+ "steps": [{ "name": "Cancela el issue", "function": "cancelIssue" }]
6
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "finish",
3
+ "guards": ["isGitApi"],
4
+ "description": "Comando para teminar un requerimiento. Automatiza las acciones cuando se termino el desarrollo de un requerimiento",
5
+ "steps": [
6
+ {
7
+ "criteria": { "field": "isDevelopment", "value": true },
8
+ "subtask": "validate-scratch"
9
+ },
10
+ {
11
+ "name": "chequea si hay cambios sin commit",
12
+ "function": "checkCommitPending",
13
+ "description": "Chequea si hay algo sin commitear:\n ${salida}",
14
+ "errorMessage": "Tiene modificaciones pendientes",
15
+ "onError": "commitChanges"
16
+ },
17
+ {
18
+ "criteria": { "field": "isDevelopment", "value": true },
19
+ "subtask": "update-documentation"
20
+ },
21
+ {
22
+ "criteria": { "field": "isDevelopment", "value": true },
23
+ "subtask": "validate-code"
24
+ },
25
+ {
26
+ "name": "publica la branch",
27
+ "subtask": "publish-branch",
28
+ "description": "Publica la branch en Remote",
29
+ "errorMessage": "No se pudo publicar la branch"
30
+ },
31
+ {
32
+ "name": "crea el pull request",
33
+ "subtask": "create-pull",
34
+ "description": "Crea el pull request"
35
+ },
36
+ {
37
+ "criteria": { "field": "isDevelopment", "value": true },
38
+ "subtask": "drop-scratch"
39
+ }
40
+ ]
41
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "list",
3
+ "guards": ["isGitApi"],
4
+ "description": "Comando para ver en detalle el requerimiento",
5
+ "steps": [
6
+ {
7
+ "name": "Ver los issues del Backlog",
8
+ "function": "listIssues"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "publish",
3
+ "guards": ["$NPM_TOKEN"],
4
+ "arguments": {
5
+ "newVersion": { "required": true }
6
+ },
7
+ "description": "Comando para publicar un requerimiento al ambiente",
8
+ "steps": [
9
+ { "name": "Paquetiza", "subtask": "pack" },
10
+ { "name": "Actualiza la version", "function": "storeConfig", "arguments": ["version", "${newVersion}"] },
11
+ { "name": "Publica", "command": "yarn publish ", "arguments": {"--new-version": "${newVersion}"} }
12
+ ]
13
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "start",
3
+ "guards": ["isGitApi"],
4
+ "arguments": ["newIssueNumber"],
5
+ "description": "Comando para iniciar un requerimiento. Automatiza las acciones cuando se arranca un requerimiento nuevo",
6
+ "steps": [
7
+ {
8
+ "name": "validate issue",
9
+ "function": "validateIssue",
10
+ "arguments": ["${newIssueNumber}", "Ready,Backlog"],
11
+ "description": "Valida que Issue este en la Columna Ready o Backlog",
12
+ "errorMessage": "Por favor verifique que el issue ${newIssueNumber} este en la columna Ready o Backlog"
13
+ },
14
+ {
15
+ "name": "check Issue type based on Labels",
16
+ "function": "checkIssueType",
17
+ "arguments": ["${newIssueNumber}"],
18
+ "description": "Verifica si el issueType es de Desarrollo o No segun los labels (no desa son automation, documentation)"
19
+ },
20
+ { "subtask": "checkout-branch", "arguments": ["${newBranchName}"] },
21
+ {
22
+ "name": "Mueve el issue a In Progress",
23
+ "function": "moveIssue",
24
+ "arguments": ["${newIssueNumber}", "In Progress"],
25
+ "errorMessage": "No se pudo mover el issue a inprogress, hagalo manualmente"
26
+ },
27
+ {
28
+ "name": "Me Asigna el issue",
29
+ "function": "assignIssueToMe",
30
+ "arguments": ["${newIssueNumber}"],
31
+ "errorMessage": "No se pudo pudo asignar la branch (${newBranchName}) al issue. Por favor hagalo manualmente",
32
+ "onError": "skip"
33
+ },
34
+ {
35
+ "name": "Pone la branch en el issue",
36
+ "function": "assignBranchToIssue",
37
+ "arguments": {
38
+ "newBranchName": "${newBranchName}",
39
+ "issueNumber": "${newIssueNumber}"
40
+ },
41
+ "errorMessage": "No se pudo asignar la branch ${newBranchName} al issue ${newIssueNumber}. Hagalo manualmente",
42
+ "onError": "skip"
43
+ },
44
+ {
45
+ "name": "Asocia la branch con el remote",
46
+ "command": "git push -u origin",
47
+ "arguments": ["${newBranchName}"],
48
+ "errorMessage": "No se pudo asociar la branch ${newBranchNamed} al remote. verifique con git branch -vv "
49
+ }
50
+ ]
51
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "stop",
3
+ "guards": ["isGitApi"],
4
+ "description": "Comando para dejar a un lado un requerimiento",
5
+ "steps": [
6
+ {
7
+ "criteria": { "field": "isDevelopment", "value": true },
8
+ "subtask": "validate-scratch"
9
+ },
10
+ {
11
+ "criteria": { "field": "isDevelopment", "value": true },
12
+ "subtask": "update-documentation"
13
+ },
14
+ {
15
+ "name": "chequea si hay cambios sin commit",
16
+ "function": "checkCommitPending",
17
+ "description": "Chequea si hay algo sin commitear:\n ${salida}",
18
+ "errorMessage": "Tiene modificaciones pendientes",
19
+ "onError": "commitChanges"
20
+ },
21
+ {
22
+ "name": "publica la branch",
23
+ "subtask": "publish-branch",
24
+ "description": "Publica la branch en Remote",
25
+ "errorMessage": "No se pudo publicar la branch"
26
+ },
27
+ {
28
+ "criteria": { "field": "isDevelopment", "value": true },
29
+ "subtask": "drop-scratch"
30
+ }
31
+ ]
32
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "switch",
3
+ "guards": ["isGitApi"],
4
+ "arguments": ["newIssueNumber"],
5
+ "description": "Comando para cambiar el requerimiento a desarrollar",
6
+ "steps": [
7
+ {
8
+ "name": "validate issue",
9
+ "function": "validateIssue",
10
+ "arguments": ["${newIssueNumber}", "In Progress"],
11
+ "description": "Valida que Issue este en la Columna In Progress",
12
+ "errorMessage": "Por favor verifique que el issue ${newIssueNumber} este en la columna In Progress"
13
+ },
14
+ {
15
+ "name": "check Issue type based on Labels",
16
+ "function": "checkIssueType",
17
+ "arguments": ["${newIssueNumber}"],
18
+ "description": "Verifica si el issueType es de Desarrollo o No segun los labels (no desa son automation, documentation)"
19
+ },
20
+ {
21
+ "name": "Se fija que este parado en ${newBranchName}",
22
+ "function": "validaNoseaBranchActual",
23
+ "arguments": ["${newBranchName}"],
24
+ "description": "Valida que no sea la branch actual",
25
+ "errorMessage": "Ya esta parado sobre la branch ${newBranchName}"
26
+ },
27
+ {
28
+ "criteria": { "field": "isDevelopment", "value": true },
29
+ "subtask": "update-documentation"
30
+ },
31
+ {
32
+ "criteria": { "field": "isDevelopment", "value": true },
33
+ "subtask": "validate-scratch"
34
+ },
35
+ { "subtask": "checkout-branch", "arguments": ["${newBranchName}"] },
36
+ {
37
+ "criteria": { "field": "isNewDevelopment", "value": true },
38
+ "name": "switch scratch",
39
+ "command": "sf force config set target-org",
40
+ "arguments": { "--target-org": "${newBranchName}" },
41
+ "description": "Cambia la scratch",
42
+ "errorMessage": "No se pudo mover al scratch ${newBranchName}. Hagalo manualmente ${command}"
43
+ },
44
+ {
45
+ "criteria": { "field": "isNewDevelopment", "value": true },
46
+ "name": "deploy scratch localmente",
47
+ "command": "sf project deploy start",
48
+ "arguments": { "--target-org": "${newBranchName}" },
49
+ "description": "Deploy por si hubo cambios en main",
50
+ "errorMessage": "No se pudo mover al scratch ${newBranchName}. Hagalo manualmente ${command}"
51
+ }
52
+ ]
53
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "view",
3
+ "guards": ["isGitApi"],
4
+ "arguments": ["issueNumber"],
5
+ "description": "Comando para ver en detalle el requerimiento",
6
+ "steps": [
7
+ {
8
+ "name": "Ver datos del issue",
9
+ "function": "viewIssue",
10
+ "arguments": ["${issueNumber}"]
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,18 @@
1
+ [
2
+ {
3
+ "title": "Continious Delivery con Scratch Orgs",
4
+ "value": "modelA",
5
+ "description": "Github workflow pensado en soluciones para Clientes finales"
6
+ },
7
+ {
8
+ "title": "Second Generation Packages con Scratch Orgs",
9
+ "value": "modelB",
10
+ "description": "Gitflow workflow pensado para ISV"
11
+ },
12
+ {
13
+ "title": "Paquetes de NPM",
14
+ "value": "modelC",
15
+ "description": "Para herramientas complementarias como autoforce"
16
+ }
17
+ ]
18
+
package/lib/auto.js CHANGED
@@ -12,6 +12,7 @@ import { createObject, validateTask, getTasks, helpTask, runTask, getTaskFolder
12
12
  import { logError } from "./helpers/color.js";
13
13
  import prompts from "prompts";
14
14
  import { createConfigurationFile } from "./helpers/util.js";
15
+ import context from "./helpers/context.js";
15
16
  const proxyCommand = {
16
17
  'version': showVersion,
17
18
  'config': createConfigurationFile
@@ -24,7 +25,7 @@ const taskCommand = {
24
25
  };
25
26
  function showVersion() {
26
27
  return __awaiter(this, void 0, void 0, function* () {
27
- console.log('AutoForce v0.1.4');
28
+ console.log('AutoForce v' + context.version);
28
29
  return true;
29
30
  });
30
31
  }
@@ -9,8 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import sf from "./connect.js";
11
11
  import templateGenerator from "./template.js";
12
- const templateEngine = templateGenerator("dictionary", "md");
13
- import { sortByName, getNamesByExtension, verFecha, splitFilename, DICTIONARY_FOLDER, TEMPLATES_FOLDER } from "./util.js";
12
+ import { DICTIONARY_FOLDER, TEMPLATE_MODEL_FOLDER } from "./util.js";
13
+ const templateEngine = templateGenerator(`${TEMPLATE_MODEL_FOLDER}/dictionary`, "md");
14
+ import { sortByName, getNamesByExtension, verFecha, splitFilename } from "./util.js";
14
15
  function getMetadata(clases) {
15
16
  return __awaiter(this, void 0, void 0, function* () {
16
17
  try {
@@ -189,7 +190,7 @@ function executeClasses(items, filename, folder) {
189
190
  classLink
190
191
  }
191
192
  });
192
- templateEngine.save(filename, TEMPLATES_FOLDER + "/" + folder);
193
+ templateEngine.save(filename, +"/" + folder);
193
194
  });
194
195
  }
195
196
  const classModule = {
@@ -15,20 +15,22 @@ export declare enum ProjectServices {
15
15
  declare class Context implements IObjectRecord {
16
16
  [s: string]: AnyValue | undefined;
17
17
  model: string;
18
+ modelTemplates: string;
18
19
  gitServices: GitServices;
19
20
  isGitApi: boolean;
20
21
  gitApi: IGitApi | undefined;
22
+ version: string | undefined;
21
23
  projectServices: ProjectServices;
22
24
  isProjectApi: boolean;
23
25
  projectApi: IProjectApi | undefined;
24
26
  sfInstalled: boolean;
25
27
  sfToken: boolean;
26
28
  branchName: string | undefined;
27
- issueNumber: number | undefined;
29
+ issueNumber: string | undefined;
28
30
  issueType: string | undefined;
29
31
  _process: string | undefined;
30
32
  _processesHeader: Record<string, IProcessHeader> | undefined;
31
- _newIssueNumber: number | undefined;
33
+ _newIssueNumber: string | undefined;
32
34
  _newIssueType: string | undefined;
33
35
  newBranchName: string | undefined;
34
36
  defaultDias: number;
@@ -67,11 +69,11 @@ declare class Context implements IObjectRecord {
67
69
  get scratch(): OrganizationInfo;
68
70
  validate(guards: string[]): Promise<void>;
69
71
  issueFromBranch(branchName: string): void;
70
- branchNameFromIssue(issueType: string, issueNumber: number, title?: string): string;
72
+ branchNameFromIssue(issueType: string, issueNumber: string, title?: string): string;
71
73
  get isDevelopment(): boolean;
72
74
  get isNewDevelopment(): boolean;
73
- get newIssueNumber(): number | undefined;
74
- set newIssueNumber(value: number | undefined);
75
+ get newIssueNumber(): string | undefined;
76
+ set newIssueNumber(value: string | undefined);
75
77
  get newIssueType(): string | undefined;
76
78
  set newIssueType(value: string | undefined);
77
79
  setNewBranchName(): void;
@@ -33,7 +33,8 @@ const filterProcesses = (fullPath) => fullPath.endsWith(".md"); // && !fullPath.
33
33
  const ISSUES_TYPES = [{ value: 'feature', title: 'feature' }, { value: 'bug', title: 'bug' }, { value: 'documentation', title: 'documentation' }, { value: 'automation', title: 'automation' }];
34
34
  class Context {
35
35
  constructor() {
36
- this.model = 'modelA'; // Default Model
36
+ this.model = 'modelA'; // Default Model de commands
37
+ this.modelTemplates = 'modelA'; // Default Model de templates
37
38
  this.gitServices = GitServices.None;
38
39
  this.isGitApi = false;
39
40
  this.projectServices = ProjectServices.None;
@@ -45,7 +46,7 @@ class Context {
45
46
  this.existNewBranch = false;
46
47
  // Ultima salida del shell
47
48
  this.salida = '';
48
- this.backlogColumn = 'Backlog';
49
+ this.backlogColumn = 'Todo';
49
50
  }
50
51
  loadProjectApi() {
51
52
  if (!this.isProjectApi) {
@@ -242,9 +243,17 @@ class Context {
242
243
  validate(guards) {
243
244
  return __awaiter(this, void 0, void 0, function* () {
244
245
  for (const guard of guards) {
245
- const value = yield this.get(guard);
246
- if (!value) {
247
- throw new Error(`No se encontro la variable ${guard} en el contexto. Ejecute yarn auto config o lea el index.md para mas informacion.`);
246
+ // Chequeo de variables de entorno
247
+ if (guard[0] === '$') {
248
+ if (!process.env[guard.substring(1)]) {
249
+ throw new Error(`La variable de entorno ${guard} no esta configurada.`);
250
+ }
251
+ }
252
+ else {
253
+ const value = yield this.get(guard);
254
+ if (!value) {
255
+ throw new Error(`No se encontro la variable ${guard} en el contexto. Ejecute yarn auto config o lea el index.md para mas informacion.`);
256
+ }
248
257
  }
249
258
  }
250
259
  });
@@ -254,7 +263,7 @@ class Context {
254
263
  if (branchSplit.length > 1) {
255
264
  this.issueType = branchSplit[0];
256
265
  if (!Number.isNaN(Number(branchSplit[1]))) {
257
- this.issueNumber = parseInt(branchSplit[1]);
266
+ this.issueNumber = branchSplit[1];
258
267
  }
259
268
  else {
260
269
  // [this.issueNumber, this.issueTitle] = branchSplit[1].split() // /^([^ -]+)[ -](.*)$/.exec( branchSplit[1]).slice(1);
@@ -450,7 +459,7 @@ class Context {
450
459
  }
451
460
  setObject(obj) {
452
461
  for (const field in obj) {
453
- Object.defineProperty(this, field, obj[field]);
462
+ Object.defineProperty(this, field, { value: obj[field], writable: true });
454
463
  }
455
464
  }
456
465
  set(key, value) {
@@ -509,10 +518,11 @@ class Context {
509
518
  }
510
519
  }
511
520
  const context = new Context();
521
+ context.loadConfig();
512
522
  let initialized = false;
513
523
  export function initializeContext() {
514
524
  try {
515
- if (!initialized) {
525
+ if (initialized === false) {
516
526
  context.init();
517
527
  initialized = true;
518
528
  }