autoforce 0.1.24 → 0.1.26

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/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # Versiones
2
2
 
3
+ 0.1.26
4
+ ## Version 0.1.26
5
+ - Fecha:
6
+ - Paquete: [Descargar](https://www.npmjs.com/package/autoforce/v/0.1.26)
7
+ - Cambios:
8
+ * Bugfixing de create-scracth para autoforce-test
9
+
10
+
11
+ 0.1.25
12
+ ## Version 0.1.25
13
+ - Fecha:
14
+ - Paquete: [Descargar](https://www.npmjs.com/package/autoforce/v/0.1.25)
15
+ - Cambios:
16
+ * Bugfixing de carpeta de subtask para seguir con la automatizacion de autoforce-test
17
+
18
+ 0.1.24
19
+ ## Version 0.1.24
20
+ - Fecha:
21
+ - Paquete: [Descargar](https://www.npmjs.com/package/autoforce/v/0.1.24)
22
+ - Cambios:
23
+ * Funcionalidada nueva de Search Issues
24
+ * Usar el title como identificador de issue (--issue)
25
+
26
+
3
27
  0.1.23
4
28
  ## Version 0.1.23
5
29
  - Fecha:
@@ -24,6 +24,7 @@ declare class Context implements IObjectRecord {
24
24
  gitModel: string | undefined;
25
25
  docModel: string | undefined;
26
26
  errorMessage: string;
27
+ projectPath: string;
27
28
  projectModel: string | undefined;
28
29
  gitServices: GitServices;
29
30
  isGitApi: boolean;
@@ -43,13 +43,16 @@ function searchInFolderHierarchy(element, parentFolder) {
43
43
  }
44
44
  return '';
45
45
  }
46
+ function getProjectPath() {
47
+ return searchInFolderHierarchy('package.json', process.cwd() || '.');
48
+ }
46
49
  function getDataFromPackage() {
47
50
  const data = {};
48
51
  try {
49
- const PROJECT_FOLDER = searchInFolderHierarchy('package.json', process.cwd() || '.');
50
- const filename = `${PROJECT_FOLDER}/package.json`;
52
+ const projectPath = getProjectPath();
53
+ const filename = `${projectPath}/package.json`;
51
54
  if (!fs.existsSync(filename)) {
52
- throw new Error("No se encontro el package.json en " + PROJECT_FOLDER);
55
+ throw new Error("No se encontro el package.json en " + projectPath);
53
56
  }
54
57
  const content = fs.readFileSync(filename, "utf8");
55
58
  const packageJson = JSON.parse(content);
@@ -91,6 +94,7 @@ class Context {
91
94
  gitModel;
92
95
  docModel;
93
96
  errorMessage = '';
97
+ projectPath = getProjectPath();
94
98
  projectModel;
95
99
  gitServices = GitServices.None;
96
100
  isGitApi = false;
@@ -57,7 +57,8 @@ export async function executeCommand(step) {
57
57
  execSync(step.command + ' ' + convertArgsToString(step.arguments), { stdio: 'inherit' });
58
58
  return true;
59
59
  }
60
- catch {
60
+ catch (e) {
61
+ context.errorMessage = `Se produjo un error al ejecutar el comando: ${e}`;
61
62
  return false;
62
63
  }
63
64
  }
@@ -34,14 +34,14 @@ export function getFilesInFolders(folders, filter, recursive = false, ignoreList
34
34
  return Array.from(files);
35
35
  }
36
36
  export function getModelFolders(subfolder) {
37
- const folder = [
37
+ const folders = [
38
38
  `${MODELS_FOLDER}/dev/${context.devModel}/${subfolder}`,
39
39
  `${MODELS_FOLDER}/git/${context.gitModel}/${subfolder}`,
40
40
  `${MODELS_FOLDER}/doc/${context.docModel}/${subfolder}`,
41
41
  `${MODELS_FOLDER}/project/${context.projectModel}/${subfolder}`,
42
42
  ];
43
43
  // Filter only folders that exists
44
- return folder.filter(folder => fs.existsSync(folder));
44
+ return folders.filter(folder => fs.existsSync(folder));
45
45
  }
46
46
  function getTemplates(filter) {
47
47
  return getFilesInFolders(getModelFolders('templates'), filter);
@@ -20,7 +20,7 @@
20
20
  "--name": "${scratchName}",
21
21
  "--duration-days": "${dias}"
22
22
  },
23
- "errorMessage": "No se pudo crear la scracth org, verifique que no se haya pasado del limite scratchs (3 activas)* sf org list --clean\n* o bien si quedo en la mitad del proceso\n* sf org resume"
23
+ "errorMessage": "No se pudo crear la scracth org, verifique que no se haya pasado del limite scratchs (3 activas)* sf org list --clean\n* o bien si quedo en la mitad del proceso\n* sf org resume. Pruebe manualmente: ${command}"
24
24
  },
25
25
  {
26
26
  "criteria": { "field": "existBranchScratch", "value": true },
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "autoforce",
3
3
  "homepage": "https://sebastianclaros.github.io/autoforce",
4
4
  "private": false,
5
- "version": "0.1.24",
5
+ "version": "0.1.26",
6
6
  "keywords": [
7
7
  "Salesforce",
8
8
  "Automation",
@@ -1,60 +0,0 @@
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
- }
@@ -1,20 +0,0 @@
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
- }
@@ -1,20 +0,0 @@
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
- }