autoforce 0.1.17 → 0.1.19
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/.autoforce.json +8 -4
- package/CHANGELOG.md +20 -1
- package/lib/auto.js +50 -64
- package/lib/helpers/class.d.ts +1 -0
- package/lib/helpers/class.js +74 -80
- package/lib/helpers/connect.js +199 -213
- package/lib/helpers/context.d.ts +6 -3
- package/lib/helpers/context.js +279 -225
- package/lib/helpers/github-graphql.js +90 -113
- package/lib/helpers/github-project-graphql.js +100 -132
- package/lib/helpers/gitlab-graphql.js +68 -104
- package/lib/helpers/lwc.js +42 -48
- package/lib/helpers/metadata.js +1 -2
- package/lib/helpers/object.js +47 -55
- package/lib/helpers/openai.js +10 -22
- package/lib/helpers/taskFunctions.js +330 -386
- package/lib/helpers/tasks.d.ts +3 -6
- package/lib/helpers/tasks.js +132 -147
- package/lib/helpers/template.d.ts +9 -5
- package/lib/helpers/template.js +31 -18
- package/lib/helpers/util.d.ts +5 -6
- package/lib/helpers/util.js +131 -187
- package/models/dev/models.json +19 -0
- package/models/doc/models.json +9 -0
- package/models/git/models.json +9 -0
- package/models/project/models.json +9 -0
- package/package.json +16 -12
- package/commands/modelC/new/issue.json +0 -24
- package/commands/models.json +0 -18
- package/templates/modelB/openIssues.bash +0 -4
- package/templates/modelB/viewIssue.bash +0 -8
- package/templates/models.json +0 -12
- /package/{commands/modelA → models/dev/npm}/subtasks/checkout-branch.json +0 -0
- /package/{commands/modelA → models/dev/npm}/subtasks/create-pull.json +0 -0
- /package/{commands/modelC → models/dev/npm}/subtasks/pack.json +0 -0
- /package/{commands/modelA → models/dev/npm}/subtasks/publish-branch.json +0 -0
- /package/{commands/modelA → models/dev/npm}/tasks/cancel.json +0 -0
- /package/{commands/modelA → models/dev/npm}/tasks/finish.json +0 -0
- /package/{commands/modelC → models/dev/npm}/tasks/list.json +0 -0
- /package/{commands/modelC → models/dev/npm}/tasks/publish.json +0 -0
- /package/{commands/modelC → models/dev/npm}/tasks/start.json +0 -0
- /package/{commands/modelA → models/dev/npm}/tasks/stop.json +0 -0
- /package/{commands/modelA → models/dev/npm}/tasks/switch.json +0 -0
- /package/{commands/modelA → models/dev/npm}/tasks/view.json +0 -0
- /package/{commands/modelA → models/dev/scratchs}/subtasks/create-scratch.json +0 -0
- /package/{commands/modelA → models/dev/scratchs}/subtasks/deploy-code.json +0 -0
- /package/{commands/modelA → models/dev/scratchs}/subtasks/drop-scratch.json +0 -0
- /package/{commands/modelA → models/dev/scratchs}/subtasks/package-code.json +0 -0
- /package/{commands/modelA → models/dev/scratchs}/subtasks/validate-code.json +0 -0
- /package/{commands/modelA → models/dev/scratchs}/subtasks/validate-scratch.json +0 -0
- /package/{commands/modelC → models/dev/scratchs}/tasks/cancel.json +0 -0
- /package/{commands/modelA → models/dev/scratchs}/tasks/deploy.json +0 -0
- /package/{commands/modelC → models/dev/scratchs}/tasks/finish.json +0 -0
- /package/{commands/modelA → models/dev/scratchs}/tasks/rollback.json +0 -0
- /package/{commands/modelA → models/dev/scratchs}/tasks/start.json +0 -0
- /package/{commands/modelC → models/dev/scratchs}/tasks/stop.json +0 -0
- /package/{commands/modelC → models/dev/scratchs}/tasks/switch.json +0 -0
- /package/{commands/modelA → models/doc/processes}/new/process.json +0 -0
- /package/{commands/modelA/subtasks → models/doc/processes/subtask}/update-documentation.json +0 -0
- /package/{templates/modelA → models/doc/processes/templates}/dictionary/class-all.md +0 -0
- /package/{templates/modelA → models/doc/processes/templates}/dictionary/class-diagrama.md +0 -0
- /package/{templates/modelA → models/doc/processes/templates}/dictionary/class-inner.md +0 -0
- /package/{templates/modelA → models/doc/processes/templates}/dictionary/class-metodos.md +0 -0
- /package/{templates/modelA → models/doc/processes/templates}/dictionary/class-public.md +0 -0
- /package/{templates/modelA → models/doc/processes/templates}/dictionary/class-referencias.md +0 -0
- /package/{templates/modelA → models/doc/processes/templates}/dictionary/class.md +0 -0
- /package/{templates/modelA → models/doc/processes/templates}/dictionary/classes.md +0 -0
- /package/{templates/modelA → models/doc/processes/templates}/dictionary/object.md +0 -0
- /package/{templates/modelA → models/doc/processes/templates}/dictionary/objects.md +0 -0
- /package/{templates/modelA → models/doc/processes/templates}/intro.md +0 -0
- /package/{templates/modelA → models/doc/processes/templates}/process.md +0 -0
- /package/{commands/modelC/subtasks → models/git/githubflow/subtask}/checkout-branch.json +0 -0
- /package/{commands/modelC/subtasks → models/git/githubflow/subtask}/create-pull.json +0 -0
- /package/{commands/modelC/subtasks → models/git/githubflow/subtask}/publish-branch.json +0 -0
- /package/{commands/modelA → models/project/github-releases}/new/issue.json +0 -0
- /package/{commands/modelA/tasks → models/project/github-releases/task}/list.json +0 -0
- /package/{commands/modelC/tasks → models/project/github-releases/task}/view.json +0 -0
- /package/{templates/modelB → models/project/github-releases/templates}/changelog.md +0 -0
- /package/{templates/modelA → models/project/github-releases/templates}/openIssues.bash +0 -0
- /package/{templates/modelA → models/project/github-releases/templates}/viewIssue.bash +0 -0
package/.autoforce.json
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
{
|
2
|
-
"version": "0.1.
|
2
|
+
"version": "0.1.19",
|
3
3
|
"backlogColumn": "Todo",
|
4
|
-
"model": "modelC",
|
5
|
-
"modelTemplates": "modelB",
|
6
4
|
"gitServices": "github",
|
5
|
+
"gitModel": "githubflow",
|
6
|
+
"projectModel": "github-releases",
|
7
7
|
"projectServices": "github",
|
8
8
|
"projectId": "4",
|
9
9
|
"listFilter": "mios",
|
10
|
-
"listTemplate": "openIssues"
|
10
|
+
"listTemplate": "openIssues",
|
11
|
+
"devModel": "npm",
|
12
|
+
"docModel": "processes",
|
13
|
+
"filter": "{states: OPEN}",
|
14
|
+
"template": "openIssues"
|
11
15
|
}
|
package/CHANGELOG.md
CHANGED
@@ -1,7 +1,26 @@
|
|
1
1
|
# Versiones
|
2
2
|
|
3
|
-
## Version 0.1.
|
3
|
+
## Version 0.1.18
|
4
4
|
- Fecha:
|
5
|
+
- Paquete: [Descargar](https://www.npmjs.com/package/autoforce/v/0.1.18ra la placa
|
6
|
+
|
7
|
+
TIPO CASO: Tarea Programada SF Deploy 254 Core & Industry 4 h)
|
8
|
+
- Cambios:
|
9
|
+
* Reorganizar los modelos para que sea mas por la configuracion misma
|
10
|
+
- https://github.com/sebastianclaros/autoforce/issues/46
|
11
|
+
|
12
|
+
|
13
|
+
## Version 0.1.17
|
14
|
+
- Fecha: 13 Dic 2024
|
15
|
+
- Paquete: [Descargar](https://www.npmjs.com/package/autoforce/v/0.1.17)
|
16
|
+
- Cambios:
|
17
|
+
* [new] cuando se quiere crear un issue y se le manda --milestone=v0.1.17 manda el title y no el id
|
18
|
+
- https://github.com/sebastianclaros/autoforce/issues/44
|
19
|
+
* Poder ejecutar autoforce en un subdirectorio, hoy tira un config como que no encuentra el autoforce.json
|
20
|
+
- https://github.com/sebastianclaros/autoforce/issues/45
|
21
|
+
|
22
|
+
## Version 0.1.16
|
23
|
+
- Fecha: 12 Dic 2024
|
5
24
|
- Paquete: [Descargar](https://www.npmjs.com/package/autoforce/v/0.1.16)
|
6
25
|
- Cambios:
|
7
26
|
* [new] new milestone
|
package/lib/auto.js
CHANGED
@@ -1,14 +1,5 @@
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
-
});
|
9
|
-
};
|
10
1
|
// Comandos validos
|
11
|
-
import { createObject, validateTask, getTasks, helpTask, runTask
|
2
|
+
import { createObject, validateTask, getTasks, previewTask, helpTask, runTask } from "./helpers/tasks.js";
|
12
3
|
import { logError } from "./helpers/color.js";
|
13
4
|
import prompts from "prompts";
|
14
5
|
import { createConfigurationFile, getConfigFile } from "./helpers/util.js";
|
@@ -21,51 +12,48 @@ const proxyCommand = {
|
|
21
12
|
};
|
22
13
|
const taskCommand = {
|
23
14
|
'help': helpTask,
|
15
|
+
'preview': previewTask,
|
24
16
|
'task': runTask,
|
25
17
|
'new': runTask,
|
26
18
|
'subtask': runTask
|
27
19
|
};
|
28
|
-
function showVersion() {
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
return true;
|
34
|
-
});
|
20
|
+
async function showVersion() {
|
21
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
22
|
+
const version = getConfigFile(__dirname + '/../.autoforce.json', 'version', '0.1.14');
|
23
|
+
console.log('AutoForce v' + version);
|
24
|
+
return true;
|
35
25
|
}
|
36
|
-
export default function main() {
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
logError('Verifique que los json de task y subtask esten validos');
|
53
|
-
}
|
26
|
+
export default async function main() {
|
27
|
+
try {
|
28
|
+
const config = getConfigFromArgs(process.argv.slice(2));
|
29
|
+
const taskCommandKeys = Object.keys(taskCommand);
|
30
|
+
if (taskCommandKeys.includes(config.command)) {
|
31
|
+
const tasks = getTasks(config.subfolder);
|
32
|
+
const taskName = await askForTaskName(config.taskName, tasks);
|
33
|
+
if (taskName) {
|
34
|
+
const task = tasks[taskName];
|
35
|
+
context.options = config.arguments && task.arguments ? { ...config.options, ...createObject(task.arguments, config.arguments) } : config.options;
|
36
|
+
// Valida los json de task y subtask
|
37
|
+
if (validateTask(task)) {
|
38
|
+
await taskCommand[config.command](task, context.options);
|
39
|
+
}
|
40
|
+
else {
|
41
|
+
logError('Verifique que los json de task y subtask esten validos');
|
54
42
|
}
|
55
|
-
}
|
56
|
-
else {
|
57
|
-
yield proxyCommand[config.command](config.taskName, config.options);
|
58
43
|
}
|
59
44
|
}
|
60
|
-
|
61
|
-
|
62
|
-
console.error(error.message);
|
63
|
-
}
|
45
|
+
else {
|
46
|
+
await proxyCommand[config.command](config.taskName, config.options);
|
64
47
|
}
|
65
|
-
}
|
48
|
+
}
|
49
|
+
catch (error) {
|
50
|
+
if (error instanceof Error) {
|
51
|
+
console.error(error.message);
|
52
|
+
}
|
53
|
+
}
|
66
54
|
}
|
67
55
|
export function getConfigFromArgs(processArgs) {
|
68
|
-
const config = { options: {}, taskName: '', command: '',
|
56
|
+
const config = { options: {}, taskName: '', command: '', subfolder: '', arguments: [] };
|
69
57
|
const args = [];
|
70
58
|
// Divide --xxx como options el resto como args
|
71
59
|
for (const argName of processArgs) {
|
@@ -89,11 +77,11 @@ export function getConfigFromArgs(processArgs) {
|
|
89
77
|
}
|
90
78
|
// Setea el taskFolder segun si es un task o subtask
|
91
79
|
if ((config.command == 'help' || config.command == 'preview') && (currentArgument == 'subtask' || currentArgument == 'task')) {
|
92
|
-
config.
|
80
|
+
config.subfolder = currentArgument;
|
93
81
|
currentArgument = args.shift();
|
94
82
|
}
|
95
83
|
else {
|
96
|
-
config.
|
84
|
+
config.subfolder = config.command;
|
97
85
|
}
|
98
86
|
if (typeof currentArgument == 'string') {
|
99
87
|
config.taskName = currentArgument;
|
@@ -101,23 +89,21 @@ export function getConfigFromArgs(processArgs) {
|
|
101
89
|
config.arguments = args;
|
102
90
|
return config;
|
103
91
|
}
|
104
|
-
function askForTaskName(taskName, tasks) {
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
})
|
120
|
-
});
|
121
|
-
return response.taskName;
|
92
|
+
async function askForTaskName(taskName, tasks) {
|
93
|
+
// Si exite lo devuelve
|
94
|
+
if (tasks[taskName]) {
|
95
|
+
return taskName;
|
96
|
+
}
|
97
|
+
// Sino pregunta
|
98
|
+
const response = await prompts({
|
99
|
+
type: "select",
|
100
|
+
name: "taskName",
|
101
|
+
message: taskName
|
102
|
+
? `${taskName} no es un comando valido`
|
103
|
+
: "Seleccione un comando",
|
104
|
+
choices: Object.values(tasks).map((task) => {
|
105
|
+
return { title: task.name, value: task.name, description: task.description };
|
106
|
+
})
|
122
107
|
});
|
108
|
+
return response.taskName;
|
123
109
|
}
|
package/lib/helpers/class.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { DocumentationModule } from "../types/auto.js";
|
2
2
|
export declare function getClasses(files: string[]): string[];
|
3
|
+
export declare function executeClasses(items: string[], filename: string, folder: string): Promise<void>;
|
3
4
|
declare const classModule: DocumentationModule;
|
4
5
|
export default classModule;
|
5
6
|
/**
|
package/lib/helpers/class.js
CHANGED
@@ -1,29 +1,24 @@
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
-
});
|
9
|
-
};
|
10
1
|
import sf from "./connect.js";
|
11
|
-
import templateGenerator from "./template.js";
|
12
|
-
import { DICTIONARY_FOLDER,
|
13
|
-
|
2
|
+
import { default as templateGenerator } from "./template.js";
|
3
|
+
import { DICTIONARY_FOLDER, getModelFolders } from "./util.js";
|
4
|
+
let _templateEngine;
|
5
|
+
function getTemplateEngine() {
|
6
|
+
if (!_templateEngine) {
|
7
|
+
_templateEngine = templateGenerator(getModelFolders('dictionary'), "md");
|
8
|
+
}
|
9
|
+
return _templateEngine;
|
10
|
+
}
|
14
11
|
import { sortByName, getNamesByExtension, verFecha, splitFilename } from "./util.js";
|
15
|
-
function getMetadata(clases) {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
return [];
|
26
|
-
});
|
12
|
+
async function getMetadata(clases) {
|
13
|
+
try {
|
14
|
+
await sf.connect();
|
15
|
+
const classRecords = await sf.getClasses(clases);
|
16
|
+
return Array.isArray(classRecords) ? classRecords : [classRecords];
|
17
|
+
}
|
18
|
+
catch (e) {
|
19
|
+
console.error(e);
|
20
|
+
}
|
21
|
+
return [];
|
27
22
|
}
|
28
23
|
export function getClasses(files) {
|
29
24
|
const items = new Set();
|
@@ -128,70 +123,69 @@ function getInnerClasses(classes) {
|
|
128
123
|
}
|
129
124
|
return ret;
|
130
125
|
}
|
131
|
-
function executeClasses(items, filename, folder) {
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
helpers: {
|
146
|
-
verFecha,
|
147
|
-
modifiers,
|
148
|
-
linkToType,
|
149
|
-
classLinkGraph,
|
150
|
-
filterByPublic,
|
151
|
-
classAttributes,
|
152
|
-
scopeModifiers
|
153
|
-
}
|
154
|
-
});
|
155
|
-
templateEngine.save(context.Name, DICTIONARY_FOLDER + "/classes");
|
156
|
-
}
|
157
|
-
// Saca las innerClass y las pone como clases con namespace
|
158
|
-
const innerClasses = getInnerClasses(contexts);
|
159
|
-
const namespaces = {};
|
160
|
-
if (innerClasses.length > 0) {
|
161
|
-
templateEngine.read("class-inner");
|
162
|
-
for (const context of innerClasses) {
|
163
|
-
templateEngine.render(context, {
|
164
|
-
helpers: { verFecha, modifiers, linkToType }
|
165
|
-
});
|
166
|
-
templateEngine.save(context.Name, DICTIONARY_FOLDER + "/classes/" + context.namespace);
|
167
|
-
// arma un mapa de namespace con el array de sus innerclases
|
168
|
-
if (context.namespace) {
|
169
|
-
if (namespaces[context.namespace] === undefined) {
|
170
|
-
namespaces[context.namespace] = [context.Name];
|
171
|
-
}
|
172
|
-
else {
|
173
|
-
namespaces[context.namespace].push(context.Name);
|
174
|
-
}
|
175
|
-
}
|
176
|
-
}
|
177
|
-
contexts = contexts.concat(innerClasses);
|
178
|
-
}
|
179
|
-
// Arma el documento indice del grupo de clases
|
180
|
-
contexts.sort(sortByName);
|
181
|
-
templateEngine.read("classes");
|
182
|
-
const classContext = { classes: contexts, namespaces };
|
183
|
-
templateEngine.render(classContext, {
|
126
|
+
export async function executeClasses(items, filename, folder) {
|
127
|
+
const templateEngine = getTemplateEngine();
|
128
|
+
if (items.length === 0) {
|
129
|
+
return;
|
130
|
+
}
|
131
|
+
// Busca la metadata
|
132
|
+
let contexts = await getMetadata(items);
|
133
|
+
if (!contexts || contexts.length === 0) {
|
134
|
+
return;
|
135
|
+
}
|
136
|
+
// Arma el diccionario de cada Clase
|
137
|
+
templateEngine.read("class");
|
138
|
+
for (const context of contexts) {
|
139
|
+
templateEngine.render(context, {
|
184
140
|
helpers: {
|
185
141
|
verFecha,
|
186
142
|
modifiers,
|
187
143
|
linkToType,
|
188
|
-
filterByPublic,
|
189
144
|
classLinkGraph,
|
190
|
-
|
145
|
+
filterByPublic,
|
146
|
+
classAttributes,
|
147
|
+
scopeModifiers
|
191
148
|
}
|
192
149
|
});
|
193
|
-
templateEngine.save(
|
150
|
+
templateEngine.save(context.Name, DICTIONARY_FOLDER + "/classes");
|
151
|
+
}
|
152
|
+
// Saca las innerClass y las pone como clases con namespace
|
153
|
+
const innerClasses = getInnerClasses(contexts);
|
154
|
+
const namespaces = {};
|
155
|
+
if (innerClasses.length > 0) {
|
156
|
+
templateEngine.read("class-inner");
|
157
|
+
for (const context of innerClasses) {
|
158
|
+
templateEngine.render(context, {
|
159
|
+
helpers: { verFecha, modifiers, linkToType }
|
160
|
+
});
|
161
|
+
templateEngine.save(context.Name, DICTIONARY_FOLDER + "/classes/" + context.namespace);
|
162
|
+
// arma un mapa de namespace con el array de sus innerclases
|
163
|
+
if (context.namespace) {
|
164
|
+
if (namespaces[context.namespace] === undefined) {
|
165
|
+
namespaces[context.namespace] = [context.Name];
|
166
|
+
}
|
167
|
+
else {
|
168
|
+
namespaces[context.namespace].push(context.Name);
|
169
|
+
}
|
170
|
+
}
|
171
|
+
}
|
172
|
+
contexts = contexts.concat(innerClasses);
|
173
|
+
}
|
174
|
+
// Arma el documento indice del grupo de clases
|
175
|
+
contexts.sort(sortByName);
|
176
|
+
templateEngine.read("classes");
|
177
|
+
const classContext = { classes: contexts, namespaces };
|
178
|
+
templateEngine.render(classContext, {
|
179
|
+
helpers: {
|
180
|
+
verFecha,
|
181
|
+
modifiers,
|
182
|
+
linkToType,
|
183
|
+
filterByPublic,
|
184
|
+
classLinkGraph,
|
185
|
+
classLink
|
186
|
+
}
|
194
187
|
});
|
188
|
+
templateEngine.save(filename, +"/" + folder);
|
195
189
|
}
|
196
190
|
const classModule = {
|
197
191
|
getItems: getClasses,
|