@devquest/cli 1.1.4 → 1.1.5
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/dist/utils/tests/build-your-own-ai-framework.js +21 -24
- package/dist/utils/tests/build-your-own-compiler.js +6 -7
- package/dist/utils/tests/build-your-own-git.js +12 -14
- package/dist/utils/tests/build-your-own-interpreter.js +6 -7
- package/dist/utils/tests/build-your-own-shell.js +6 -9
- package/dist/utils/tests/build-your-own-vercel.js +6 -7
- package/package.json +1 -1
|
@@ -15,15 +15,14 @@ function runStage(stageOrder, cwd) {
|
|
|
15
15
|
const code = `
|
|
16
16
|
let userApp: any;
|
|
17
17
|
try { userApp = require('./src/index'); }
|
|
18
|
-
catch(e
|
|
18
|
+
catch(e) { console.error('[!] Falha ao importar src/index.ts: ' + e.message); process.exit(1); }
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
function assert(condition, failMsg, expected, got) {
|
|
20
|
+
function assert(condition, failMsg, expected, got) {
|
|
22
21
|
if (!condition) {
|
|
23
|
-
console.error('
|
|
24
|
-
console.error(
|
|
25
|
-
console.error(
|
|
26
|
-
console.error(
|
|
22
|
+
console.error('\n[FALHA DE ASSERÇÃO]\n');
|
|
23
|
+
console.error('📝 Resumo: ' + failMsg + '\n');
|
|
24
|
+
console.error('🎯 ESPERADO\n' + expected + '\n');
|
|
25
|
+
console.error('💥 RECEBIDO\n' + got + '\n');
|
|
27
26
|
process.exit(1);
|
|
28
27
|
}
|
|
29
28
|
}
|
|
@@ -63,7 +62,7 @@ function runStage(stageOrder, cwd) {
|
|
|
63
62
|
assert(result === 'DevQuest LLM Response', 'Retorno da função incorreto.', 'DevQuest LLM Response', result);
|
|
64
63
|
|
|
65
64
|
console.log('PASS');
|
|
66
|
-
} catch(e
|
|
65
|
+
} catch(e) {
|
|
67
66
|
console.error(e.message);
|
|
68
67
|
process.exit(1);
|
|
69
68
|
}
|
|
@@ -90,15 +89,14 @@ function runStage(stageOrder, cwd) {
|
|
|
90
89
|
const code = `
|
|
91
90
|
let userApp: any;
|
|
92
91
|
try { userApp = require('./src/index'); }
|
|
93
|
-
catch(e
|
|
92
|
+
catch(e) { console.error('[!] Erro de importação: ' + e.message); process.exit(1); }
|
|
94
93
|
|
|
95
|
-
|
|
96
|
-
function assert(condition, failMsg, expected, got) {
|
|
94
|
+
function assert(condition, failMsg, expected, got) {
|
|
97
95
|
if (!condition) {
|
|
98
|
-
console.error('
|
|
99
|
-
console.error(
|
|
100
|
-
console.error(
|
|
101
|
-
console.error(
|
|
96
|
+
console.error('\n[FALHA DE ASSERÇÃO]\n');
|
|
97
|
+
console.error('📝 Resumo: ' + failMsg + '\n');
|
|
98
|
+
console.error('🎯 ESPERADO\n' + expected + '\n');
|
|
99
|
+
console.error('💥 RECEBIDO\n' + got + '\n');
|
|
102
100
|
process.exit(1);
|
|
103
101
|
}
|
|
104
102
|
}
|
|
@@ -112,7 +110,7 @@ function runStage(stageOrder, cwd) {
|
|
|
112
110
|
assert(typeof model.doGenerate === 'function', 'O adaptador instanciado via openai() deve ter o método doGenerate().', 'function', typeof model.doGenerate);
|
|
113
111
|
|
|
114
112
|
console.log('PASS');
|
|
115
|
-
} catch(e
|
|
113
|
+
} catch(e) {
|
|
116
114
|
console.error(e.message);
|
|
117
115
|
process.exit(1);
|
|
118
116
|
}
|
|
@@ -139,15 +137,14 @@ function runStage(stageOrder, cwd) {
|
|
|
139
137
|
const code = `
|
|
140
138
|
let userApp: any;
|
|
141
139
|
try { userApp = require('./src/index'); }
|
|
142
|
-
catch(e
|
|
140
|
+
catch(e) { console.error('[!] Erro de importação: ' + e.message); process.exit(1); }
|
|
143
141
|
|
|
144
|
-
|
|
145
|
-
function assert(condition, failMsg, expected, got) {
|
|
142
|
+
function assert(condition, failMsg, expected, got) {
|
|
146
143
|
if (!condition) {
|
|
147
|
-
console.error('
|
|
148
|
-
console.error(
|
|
149
|
-
console.error(
|
|
150
|
-
console.error(
|
|
144
|
+
console.error('\n[FALHA DE ASSERÇÃO]\n');
|
|
145
|
+
console.error('📝 Resumo: ' + failMsg + '\n');
|
|
146
|
+
console.error('🎯 ESPERADO\n' + expected + '\n');
|
|
147
|
+
console.error('💥 RECEBIDO\n' + got + '\n');
|
|
151
148
|
process.exit(1);
|
|
152
149
|
}
|
|
153
150
|
}
|
|
@@ -180,7 +177,7 @@ function runStage(stageOrder, cwd) {
|
|
|
180
177
|
assert(result.finishReason === 'stop', 'Propriedade \\'finishReason\\' ausente ou incorreta no retorno.', 'stop', result.finishReason);
|
|
181
178
|
|
|
182
179
|
console.log('PASS');
|
|
183
|
-
} catch(e
|
|
180
|
+
} catch(e) {
|
|
184
181
|
console.error(e.message);
|
|
185
182
|
process.exit(1);
|
|
186
183
|
}
|
|
@@ -17,13 +17,12 @@ function runStage(stageOrder, cwd) {
|
|
|
17
17
|
const fs = require('fs');
|
|
18
18
|
const path = require('path');
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
function assert(condition, failMsg, expected, got) {
|
|
20
|
+
function assert(condition, failMsg, expected, got) {
|
|
22
21
|
if (!condition) {
|
|
23
|
-
console.error('
|
|
24
|
-
console.error(
|
|
25
|
-
console.error(
|
|
26
|
-
console.error(
|
|
22
|
+
console.error('\n[FALHA DE ASSERÇÃO]\n');
|
|
23
|
+
console.error('📝 Resumo: ' + failMsg + '\n');
|
|
24
|
+
console.error('🎯 ESPERADO\n' + expected + '\n');
|
|
25
|
+
console.error('💥 RECEBIDO\n' + got + '\n');
|
|
27
26
|
process.exit(1);
|
|
28
27
|
}
|
|
29
28
|
}
|
|
@@ -41,7 +40,7 @@ function runStage(stageOrder, cwd) {
|
|
|
41
40
|
|
|
42
41
|
console.log('PASS');
|
|
43
42
|
if (fs.existsSync(testFile)) fs.unlinkSync(testFile);
|
|
44
|
-
} catch(e
|
|
43
|
+
} catch(e) {
|
|
45
44
|
console.error(e.stderr?.toString() || e.message);
|
|
46
45
|
process.exit(1);
|
|
47
46
|
}
|
|
@@ -16,14 +16,13 @@ function runStage(stageOrder, cwd) {
|
|
|
16
16
|
const fs = require('fs');
|
|
17
17
|
const path = require('path');
|
|
18
18
|
const { execSync } = require('child_process');
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
|
|
21
20
|
function assert(condition, failMsg, expected, got) {
|
|
22
21
|
if (!condition) {
|
|
23
|
-
console.error('
|
|
24
|
-
console.error(
|
|
25
|
-
console.error(
|
|
26
|
-
console.error(
|
|
22
|
+
console.error('\n[FALHA DE ASSERÇÃO]\n');
|
|
23
|
+
console.error('📝 Resumo: ' + failMsg + '\n');
|
|
24
|
+
console.error('🎯 ESPERADO\n' + expected + '\n');
|
|
25
|
+
console.error('💥 RECEBIDO\n' + got + '\n');
|
|
27
26
|
process.exit(1);
|
|
28
27
|
}
|
|
29
28
|
}
|
|
@@ -43,7 +42,7 @@ function runStage(stageOrder, cwd) {
|
|
|
43
42
|
|
|
44
43
|
console.log('PASS');
|
|
45
44
|
fs.rmSync(repoPath, { recursive: true, force: true });
|
|
46
|
-
} catch(e
|
|
45
|
+
} catch(e) {
|
|
47
46
|
console.error(e.stderr?.toString() || e.message);
|
|
48
47
|
process.exit(1);
|
|
49
48
|
}
|
|
@@ -72,14 +71,13 @@ function runStage(stageOrder, cwd) {
|
|
|
72
71
|
const path = require('path');
|
|
73
72
|
const zlib = require('zlib');
|
|
74
73
|
const { execSync } = require('child_process');
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
|
|
77
75
|
function assert(condition, failMsg, expected, got) {
|
|
78
76
|
if (!condition) {
|
|
79
|
-
console.error('
|
|
80
|
-
console.error(
|
|
81
|
-
console.error(
|
|
82
|
-
console.error(
|
|
77
|
+
console.error('\n[FALHA DE ASSERÇÃO]\n');
|
|
78
|
+
console.error('📝 Resumo: ' + failMsg + '\n');
|
|
79
|
+
console.error('🎯 ESPERADO\n' + expected + '\n');
|
|
80
|
+
console.error('💥 RECEBIDO\n' + got + '\n');
|
|
83
81
|
process.exit(1);
|
|
84
82
|
}
|
|
85
83
|
}
|
|
@@ -104,7 +102,7 @@ function runStage(stageOrder, cwd) {
|
|
|
104
102
|
|
|
105
103
|
console.log('PASS');
|
|
106
104
|
fs.rmSync(repoPath, { recursive: true, force: true });
|
|
107
|
-
} catch(e
|
|
105
|
+
} catch(e) {
|
|
108
106
|
console.error(e.stderr?.toString() || e.message);
|
|
109
107
|
process.exit(1);
|
|
110
108
|
}
|
|
@@ -16,14 +16,13 @@ function runStage(stageOrder, cwd) {
|
|
|
16
16
|
const { execSync } = require('child_process');
|
|
17
17
|
const fs = require('fs');
|
|
18
18
|
const path = require('path');
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
|
|
21
20
|
function assert(condition, failMsg, expected, got) {
|
|
22
21
|
if (!condition) {
|
|
23
|
-
console.error('
|
|
24
|
-
console.error(
|
|
25
|
-
console.error(
|
|
26
|
-
console.error(
|
|
22
|
+
console.error('\n[FALHA DE ASSERÇÃO]\n');
|
|
23
|
+
console.error('📝 Resumo: ' + failMsg + '\n');
|
|
24
|
+
console.error('🎯 ESPERADO\n' + expected + '\n');
|
|
25
|
+
console.error('💥 RECEBIDO\n' + got + '\n');
|
|
27
26
|
process.exit(1);
|
|
28
27
|
}
|
|
29
28
|
}
|
|
@@ -45,7 +44,7 @@ function runStage(stageOrder, cwd) {
|
|
|
45
44
|
|
|
46
45
|
console.log('PASS');
|
|
47
46
|
if (fs.existsSync(testFile)) fs.unlinkSync(testFile);
|
|
48
|
-
} catch(e
|
|
47
|
+
} catch(e) {
|
|
49
48
|
console.error(e.stderr?.toString() || e.message);
|
|
50
49
|
process.exit(1);
|
|
51
50
|
}
|
|
@@ -15,16 +15,13 @@ function runStage(stageOrder, cwd) {
|
|
|
15
15
|
const code = `
|
|
16
16
|
const { execSync } = require('child_process');
|
|
17
17
|
const fs = require('fs');
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
|
|
20
19
|
function assert(condition, failMsg, expected, got) {
|
|
21
20
|
if (!condition) {
|
|
22
|
-
console.error('
|
|
23
|
-
console.error(
|
|
24
|
-
|
|
25
|
-
console.error(
|
|
26
|
-
console.error(chalk.bgMagenta.white.bold(' 💥 RECEBIDO ') + '\\n' + chalk.magenta(got) + '\\n');
|
|
27
|
-
|
|
21
|
+
console.error('\n[FALHA DE ASSERÇÃO]\n');
|
|
22
|
+
console.error('📝 Resumo: ' + failMsg + '\n');
|
|
23
|
+
console.error('🎯 ESPERADO\n' + expected + '\n');
|
|
24
|
+
console.error('💥 RECEBIDO\n' + got + '\n');
|
|
28
25
|
process.exit(1);
|
|
29
26
|
}
|
|
30
27
|
}
|
|
@@ -49,7 +46,7 @@ function runStage(stageOrder, cwd) {
|
|
|
49
46
|
);
|
|
50
47
|
|
|
51
48
|
console.log('PASS');
|
|
52
|
-
} catch(e
|
|
49
|
+
} catch(e) {
|
|
53
50
|
console.error(e.stderr?.toString() || e.message);
|
|
54
51
|
process.exit(1);
|
|
55
52
|
}
|
|
@@ -16,27 +16,26 @@ function runStage(stageOrder, cwd) {
|
|
|
16
16
|
const { execSync } = require('child_process');
|
|
17
17
|
const fs = require('fs');
|
|
18
18
|
|
|
19
|
-
const chalk = require('chalk');
|
|
20
19
|
function assert(condition, failMsg, expected, got) {
|
|
21
20
|
if (!condition) {
|
|
22
|
-
console.error('
|
|
23
|
-
console.error(
|
|
24
|
-
console.error(
|
|
25
|
-
console.error(
|
|
21
|
+
console.error('\n[FALHA DE ASSERÇÃO]\n');
|
|
22
|
+
console.error('📝 Resumo: ' + failMsg + '\n');
|
|
23
|
+
console.error('🎯 ESPERADO\n' + expected + '\n');
|
|
24
|
+
console.error('💥 RECEBIDO\n' + got + '\n');
|
|
26
25
|
process.exit(1);
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
async function testSuite() {
|
|
31
30
|
try {
|
|
32
|
-
console.log('-> Executando seu comando: node src/index.
|
|
31
|
+
console.log('-> Executando seu comando: npx ts-node src/index.ts deploy');
|
|
33
32
|
const output = execSync('npx ts-node src/index.ts deploy', { cwd: '${cwd}', stdio: 'pipe' });
|
|
34
33
|
|
|
35
34
|
const content = output.toString().toLowerCase();
|
|
36
35
|
assert(content.includes('deploy') || content.includes('build') || content.includes('uploading'), 'O comando deploy não iniciou o fluxo esperado.', 'Deploying...', output.toString());
|
|
37
36
|
|
|
38
37
|
console.log('PASS');
|
|
39
|
-
} catch(e
|
|
38
|
+
} catch(e) {
|
|
40
39
|
console.error(e.stderr?.toString() || e.message);
|
|
41
40
|
process.exit(1);
|
|
42
41
|
}
|