specifica-br 1.0.3 → 1.1.1
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/README.md +241 -5
- package/dist/commands/help.js +38 -40
- package/dist/commands/init.js +67 -45
- package/dist/commands/upgrade.d.ts +0 -3
- package/dist/commands/upgrade.js +92 -21
- package/dist/index.d.ts +0 -1
- package/dist/index.js +13 -16
- package/dist/settings.json +4 -0
- package/dist/types/init.d.ts +3 -2
- package/dist/types/init.js +1 -2
- package/dist/types/settings.d.ts +9 -0
- package/dist/types/settings.js +1 -0
- package/dist/utils/file-service.d.ts +5 -2
- package/dist/utils/file-service.js +65 -98
- package/dist/utils/log-service.d.ts +7 -0
- package/dist/utils/log-service.js +48 -0
- package/dist/utils/message-formatter.d.ts +1 -1
- package/dist/utils/message-formatter.js +47 -50
- package/dist/utils/settings-service.d.ts +6 -0
- package/dist/utils/settings-service.js +26 -0
- package/dist/utils/update-notifier-middleware.d.ts +59 -0
- package/dist/utils/update-notifier-middleware.js +276 -0
- package/package.json +11 -5
package/dist/index.js
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const upgrade_1 = require("./commands/upgrade");
|
|
13
|
-
const packageJson = JSON.parse(fs_extra_1.default.readFileSync(path_1.default.join(__dirname, '..', 'package.json'), 'utf-8'));
|
|
14
|
-
const program = new commander_1.Command();
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import fs from 'fs-extra';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
import { initCommand } from './commands/init.js';
|
|
7
|
+
import { helpCommand } from './commands/help.js';
|
|
8
|
+
import { upgradeCommand } from './commands/upgrade.js';
|
|
9
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf-8'));
|
|
11
|
+
const program = new Command();
|
|
15
12
|
program
|
|
16
13
|
.name('specifica-br')
|
|
17
14
|
.description('Ferramenta de automação para desenvolvimento guiado por especificações (Spec Driven Development - SDD) com IA. Otimizado para o ecossistema brasileiro.')
|
|
18
15
|
.version(packageJson.version);
|
|
19
|
-
program.addCommand(
|
|
20
|
-
program.addCommand(
|
|
21
|
-
program.addCommand(
|
|
16
|
+
program.addCommand(initCommand);
|
|
17
|
+
program.addCommand(helpCommand);
|
|
18
|
+
program.addCommand(upgradeCommand);
|
|
22
19
|
program.parse(process.argv);
|
package/dist/types/init.d.ts
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* Representa as escolhas do usuário durante o fluxo interativo.
|
|
4
4
|
*/
|
|
5
5
|
export interface InitAnswers {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
directoryConvention: 'opencode' | 'specifica-br';
|
|
7
|
+
tool?: string;
|
|
8
|
+
model?: string;
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
10
11
|
* Interface para configuração de templates.
|
package/dist/types/init.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
|
|
1
|
+
export declare class FileService {
|
|
2
|
+
createStructure(directoryConvention: 'opencode' | 'specifica-br'): Promise<void>;
|
|
3
|
+
private createDirectories;
|
|
4
|
+
private copyTemplates;
|
|
5
|
+
}
|
|
@@ -1,107 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
5
|
+
export class FileService {
|
|
6
|
+
async createStructure(directoryConvention) {
|
|
7
|
+
const commandsDestDir = directoryConvention === 'opencode'
|
|
8
|
+
? path.join(process.cwd(), '.opencode', 'commands')
|
|
9
|
+
: path.join(process.cwd(), 'specifica-br', 'commands');
|
|
10
|
+
console.log(`• Criando diretórios com convenção: ${directoryConvention}`);
|
|
11
|
+
await this.createDirectories(commandsDestDir, path.join(process.cwd(), 'specs', 'templates'));
|
|
12
|
+
await this.copyTemplates(commandsDestDir);
|
|
7
13
|
}
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.createDirectories = createDirectories;
|
|
37
|
-
exports.copyTemplates = copyTemplates;
|
|
38
|
-
const fs = __importStar(require("fs-extra"));
|
|
39
|
-
const path = __importStar(require("path"));
|
|
40
|
-
function createDirectories() {
|
|
41
|
-
const directoriesToCreate = [
|
|
42
|
-
path.join(process.cwd(), '.opencode', 'commands'),
|
|
43
|
-
path.join(process.cwd(), 'specs', 'templates')
|
|
44
|
-
];
|
|
45
|
-
directoriesToCreate.forEach((dir) => {
|
|
14
|
+
async createDirectories(commandsDestDir, templatesDestDir) {
|
|
46
15
|
try {
|
|
47
|
-
fs.
|
|
48
|
-
console.log(
|
|
16
|
+
await fs.ensureDir(commandsDestDir);
|
|
17
|
+
console.log(`✓ Diretório criado: ${commandsDestDir}`);
|
|
18
|
+
await fs.ensureDir(templatesDestDir);
|
|
19
|
+
console.log(`✓ Diretório criado: ${templatesDestDir}`);
|
|
49
20
|
}
|
|
50
21
|
catch (error) {
|
|
51
|
-
if (error instanceof Error) {
|
|
52
|
-
throw new Error(
|
|
22
|
+
if (error instanceof Error && 'code' in error && error.code === 'EACCES') {
|
|
23
|
+
throw new Error('Erro: Sem permissão para criar diretórios.');
|
|
53
24
|
}
|
|
54
|
-
throw
|
|
25
|
+
throw error;
|
|
55
26
|
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
catch (error) {
|
|
101
|
-
if (error instanceof Error) {
|
|
102
|
-
throw new Error(`Erro ao copiar arquivo ${source}: ${error.message}`);
|
|
27
|
+
}
|
|
28
|
+
async copyTemplates(commandsDestDir) {
|
|
29
|
+
const distRoot = path.resolve(__dirname, '..', 'boilerplate');
|
|
30
|
+
const templateFiles = [
|
|
31
|
+
{
|
|
32
|
+
source: path.join(distRoot, 'opencode-commands', 'gerar-prd.md'),
|
|
33
|
+
dest: path.join(commandsDestDir, 'gerar-prd.md')
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
source: path.join(distRoot, 'opencode-commands', 'gerar-techspec.md'),
|
|
37
|
+
dest: path.join(commandsDestDir, 'gerar-techspec.md')
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
source: path.join(distRoot, 'opencode-commands', 'gerar-tasks.md'),
|
|
41
|
+
dest: path.join(commandsDestDir, 'gerar-tasks.md')
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
source: path.join(distRoot, 'opencode-commands', 'executar-task.md'),
|
|
45
|
+
dest: path.join(commandsDestDir, 'executar-task.md')
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
source: path.join(distRoot, 'specs-templates', 'prd-template.md'),
|
|
49
|
+
dest: path.join(process.cwd(), 'specs', 'templates', 'prd-template.md')
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
source: path.join(distRoot, 'specs-templates', 'techspec-template.md'),
|
|
53
|
+
dest: path.join(process.cwd(), 'specs', 'templates', 'techspec-template.md')
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
source: path.join(distRoot, 'specs-templates', 'task-template.md'),
|
|
57
|
+
dest: path.join(process.cwd(), 'specs', 'templates', 'task-template.md')
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
source: path.join(distRoot, 'specs-templates', 'tasks-template.md'),
|
|
61
|
+
dest: path.join(process.cwd(), 'specs', 'templates', 'tasks-template.md')
|
|
62
|
+
}
|
|
63
|
+
];
|
|
64
|
+
for (const { source, dest } of templateFiles) {
|
|
65
|
+
if (await fs.pathExists(source)) {
|
|
66
|
+
await fs.copy(source, dest, { overwrite: true });
|
|
67
|
+
console.log(`✓ Arquivo copiado: ${path.basename(dest)}`);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
throw new Error(`Erro: Diretório de templates não encontrado em ${source}`);
|
|
103
71
|
}
|
|
104
|
-
throw new Error(`Erro ao copiar arquivo ${source}`);
|
|
105
72
|
}
|
|
106
|
-
}
|
|
73
|
+
}
|
|
107
74
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
const LOGS_DIR = path.join(process.cwd(), '.specifica-br', 'logs');
|
|
4
|
+
class LogService {
|
|
5
|
+
async ensureLogsDirectoryExists() {
|
|
6
|
+
try {
|
|
7
|
+
await fs.ensureDir(LOGS_DIR);
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
if (error.code !== 'EEXIST') {
|
|
11
|
+
throw error;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
generateLogFileName() {
|
|
16
|
+
const now = new Date();
|
|
17
|
+
const year = now.getFullYear();
|
|
18
|
+
const month = String(now.getMonth() + 1).padStart(2, '0');
|
|
19
|
+
const day = String(now.getDate()).padStart(2, '0');
|
|
20
|
+
const hours = String(now.getHours()).padStart(2, '0');
|
|
21
|
+
const minutes = String(now.getMinutes()).padStart(2, '0');
|
|
22
|
+
const seconds = String(now.getSeconds()).padStart(2, '0');
|
|
23
|
+
const fileName = `log_${year}_${month}_${day}_${hours}_${minutes}_${seconds}.txt`;
|
|
24
|
+
return fileName;
|
|
25
|
+
}
|
|
26
|
+
async logError(error, context) {
|
|
27
|
+
await this.ensureLogsDirectoryExists();
|
|
28
|
+
const logEntry = {
|
|
29
|
+
timestamp: new Date().toISOString(),
|
|
30
|
+
error: error.message,
|
|
31
|
+
stackTrace: error.stack
|
|
32
|
+
};
|
|
33
|
+
const fileName = this.generateLogFileName();
|
|
34
|
+
const filePath = path.join(LOGS_DIR, fileName);
|
|
35
|
+
let logContent = `[${logEntry.timestamp}] ERROR\n`;
|
|
36
|
+
logContent += `Message: ${logEntry.error}\n`;
|
|
37
|
+
if (context) {
|
|
38
|
+
logContent += `Context: ${context}\n`;
|
|
39
|
+
}
|
|
40
|
+
if (logEntry.stackTrace) {
|
|
41
|
+
logContent += `Stack Trace:\n${logEntry.stackTrace}\n`;
|
|
42
|
+
}
|
|
43
|
+
await fs.writeFile(filePath, logContent);
|
|
44
|
+
return path.resolve(filePath);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export { LogService };
|
|
48
|
+
export const logService = new LogService();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function showSuccessMessage(): void;
|
|
1
|
+
export declare function showSuccessMessage(directoryConvention: 'opencode' | 'specifica-br'): void;
|
|
2
2
|
export declare function showMissionMessage(): void;
|
|
3
3
|
export declare function showErrorMessage(message: string): void;
|
|
4
4
|
export declare function showInfoMessage(message: string): void;
|
|
@@ -1,68 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
console.log('');
|
|
13
|
-
console.log(
|
|
14
|
-
console.log('');
|
|
15
|
-
console.log(
|
|
16
|
-
console.log(
|
|
17
|
-
console.log(
|
|
18
|
-
console.log('');
|
|
19
|
-
console.log(
|
|
20
|
-
console.log(
|
|
21
|
-
console.log(
|
|
22
|
-
console.log(
|
|
23
|
-
console.log(
|
|
24
|
-
console.log('');
|
|
25
|
-
console.log(
|
|
26
|
-
console.log(
|
|
27
|
-
console.log(chalk_1.default.gray(' - techspec-template.md'));
|
|
28
|
-
console.log(chalk_1.default.gray(' - task-template.md'));
|
|
29
|
-
console.log(chalk_1.default.gray(' - tasks-template.md'));
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
export function showSuccessMessage(directoryConvention) {
|
|
3
|
+
const commandDir = directoryConvention === 'opencode'
|
|
4
|
+
? '.opencode/commands/'
|
|
5
|
+
: 'specifica-br/commands/';
|
|
6
|
+
console.log('');
|
|
7
|
+
console.log(chalk.green.bold('✓ Estrutura SDD criada com sucesso!'));
|
|
8
|
+
console.log('');
|
|
9
|
+
console.log(chalk.gray('Diretórios criados:'));
|
|
10
|
+
console.log(chalk.gray(` • ${commandDir}`));
|
|
11
|
+
console.log(chalk.gray(' • specs/templates/'));
|
|
12
|
+
console.log('');
|
|
13
|
+
console.log(chalk.gray('Arquivos de comandos copiados:'));
|
|
14
|
+
console.log(chalk.gray(' • gerar-prd.md'));
|
|
15
|
+
console.log(chalk.gray(' • gerar-techspec.md'));
|
|
16
|
+
console.log(chalk.gray(' • gerar-tasks.md'));
|
|
17
|
+
console.log(chalk.gray(' • executar-task.md'));
|
|
18
|
+
console.log('');
|
|
19
|
+
console.log(chalk.gray('Arquivos de templates copiados:'));
|
|
20
|
+
console.log(chalk.gray(' • prd-template.md'));
|
|
21
|
+
console.log(chalk.gray(' • techspec-template.md'));
|
|
22
|
+
console.log(chalk.gray(' • task-template.md'));
|
|
23
|
+
console.log(chalk.gray(' • tasks-template.md'));
|
|
24
|
+
console.log('');
|
|
25
|
+
console.log(chalk.gray('Para começar, navegue até o diretório de comandos e execute:'));
|
|
26
|
+
console.log(chalk.gray(` cd ${commandDir.split('/')[0]}`));
|
|
30
27
|
console.log('');
|
|
31
28
|
}
|
|
32
|
-
function showMissionMessage() {
|
|
29
|
+
export function showMissionMessage() {
|
|
33
30
|
console.log('');
|
|
34
|
-
console.log(
|
|
31
|
+
console.log(chalk.cyan.bold('Bem-vindo ao Specifica-BR!'));
|
|
35
32
|
console.log('');
|
|
36
|
-
console.log(
|
|
33
|
+
console.log(chalk.yellow('O que é Spec Driven Development (SDD)?'));
|
|
37
34
|
console.log('');
|
|
38
|
-
console.log(
|
|
39
|
-
console.log(
|
|
35
|
+
console.log(chalk.white('SDD é uma metodologia de desenvolvimento que prioriza'));
|
|
36
|
+
console.log(chalk.white('a documentação e especificação antes da escrita de código.'));
|
|
40
37
|
console.log('');
|
|
41
|
-
console.log(
|
|
38
|
+
console.log(chalk.yellow('Benefícios do SDD:'));
|
|
42
39
|
console.log('');
|
|
43
|
-
console.log(
|
|
44
|
-
console.log(
|
|
45
|
-
console.log(
|
|
46
|
-
console.log(
|
|
40
|
+
console.log(chalk.white(' • Documentação antes do código'));
|
|
41
|
+
console.log(chalk.white(' • Redução de retrabalho'));
|
|
42
|
+
console.log(chalk.white(' • Comunicação alinhada entre times'));
|
|
43
|
+
console.log(chalk.white(' • Maior qualidade e manutenibilidade'));
|
|
47
44
|
console.log('');
|
|
48
|
-
console.log(
|
|
45
|
+
console.log(chalk.yellow('Próximos passos:'));
|
|
49
46
|
console.log('');
|
|
50
|
-
console.log(
|
|
51
|
-
console.log(
|
|
52
|
-
console.log(
|
|
53
|
-
console.log(
|
|
47
|
+
console.log(chalk.white(' 1. Execute: specifica help --completo'));
|
|
48
|
+
console.log(chalk.white(' 2. Crie seu PRD usando o template'));
|
|
49
|
+
console.log(chalk.white(' 3. Gere sua Tech Spec baseada no PRD'));
|
|
50
|
+
console.log(chalk.white(' 4. Decomponha em tarefas executáveis'));
|
|
54
51
|
console.log('');
|
|
55
|
-
console.log(
|
|
52
|
+
console.log(chalk.cyan.bold('Comece agora com o comando: specifica-br help'));
|
|
56
53
|
console.log('');
|
|
57
54
|
}
|
|
58
|
-
function showErrorMessage(message) {
|
|
55
|
+
export function showErrorMessage(message) {
|
|
59
56
|
console.error('');
|
|
60
|
-
console.error(
|
|
61
|
-
console.error(
|
|
57
|
+
console.error(chalk.red.bold('Erro:'));
|
|
58
|
+
console.error(chalk.red(message));
|
|
62
59
|
console.error('');
|
|
63
60
|
}
|
|
64
|
-
function showInfoMessage(message) {
|
|
61
|
+
export function showInfoMessage(message) {
|
|
65
62
|
console.log('');
|
|
66
|
-
console.log(
|
|
63
|
+
console.log(chalk.blue('ℹ ' + message));
|
|
67
64
|
console.log('');
|
|
68
65
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
5
|
+
const SETTINGS_PATH = path.join(__dirname, '..', 'settings.json');
|
|
6
|
+
class SettingsService {
|
|
7
|
+
async getSettings() {
|
|
8
|
+
try {
|
|
9
|
+
const settingsContent = await fs.readFile(SETTINGS_PATH, 'utf-8');
|
|
10
|
+
const settings = JSON.parse(settingsContent);
|
|
11
|
+
return settings;
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
const errorCode = error.code;
|
|
15
|
+
if (errorCode === 'ENOENT') {
|
|
16
|
+
const defaultSettings = {
|
|
17
|
+
enabledUpgradeCommands: ['init', 'help', 'upgrade']
|
|
18
|
+
};
|
|
19
|
+
return defaultSettings;
|
|
20
|
+
}
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export { SettingsService };
|
|
26
|
+
export const settingsService = new SettingsService();
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
declare class UpdateNotifierMiddleware {
|
|
2
|
+
private shouldNotify;
|
|
3
|
+
private getLatestVersion;
|
|
4
|
+
/**
|
|
5
|
+
* Obtém a versão mais recente com timeout configurável
|
|
6
|
+
* @param packageName Nome do pacote
|
|
7
|
+
* @param timeoutMs Timeout em milissegundos
|
|
8
|
+
* @returns Promise com a versão ou null em caso de timeout/erro
|
|
9
|
+
*/
|
|
10
|
+
private getLatestVersionWithTimeout;
|
|
11
|
+
/**
|
|
12
|
+
* Verifica se há uma nova versão disponível
|
|
13
|
+
* @param currentVersion Versão atual
|
|
14
|
+
* @param latestVersion Versão mais recente
|
|
15
|
+
* @returns boolean true se houver nova versão
|
|
16
|
+
*/
|
|
17
|
+
private isNewVersionAvailable;
|
|
18
|
+
/**
|
|
19
|
+
* Obtém a versão atual do package.json
|
|
20
|
+
* @returns string com a versão atual
|
|
21
|
+
*/
|
|
22
|
+
private getCurrentVersion;
|
|
23
|
+
private isValidVersion;
|
|
24
|
+
private getUpdateType;
|
|
25
|
+
/**
|
|
26
|
+
* Exibe prompt interativo perguntando se o usuário deseja atualizar
|
|
27
|
+
* @param latestVersion Versão mais recente disponível
|
|
28
|
+
* @returns Promise<boolean> true se o usuário aceitar atualizar
|
|
29
|
+
*/
|
|
30
|
+
private promptUserForUpdate;
|
|
31
|
+
/**
|
|
32
|
+
* Exibe prompt de retry após falha na atualização
|
|
33
|
+
* @returns Promise<boolean> true se o usuário quiser tentar novamente
|
|
34
|
+
*/
|
|
35
|
+
private promptForRetry;
|
|
36
|
+
/**
|
|
37
|
+
* Executa a atualização do pacote via npm install -g
|
|
38
|
+
* @param retryCount Número de tentativas já realizadas
|
|
39
|
+
* @returns Promise<void>
|
|
40
|
+
*/
|
|
41
|
+
private executeUpdate;
|
|
42
|
+
/**
|
|
43
|
+
* Exibe notificação e prompt interativo para atualização
|
|
44
|
+
* @param latestVersion Versão mais recente disponível
|
|
45
|
+
* @param originalAction Função original a ser executada se recusar atualização
|
|
46
|
+
* @returns Promise<void>
|
|
47
|
+
*/
|
|
48
|
+
private displayNotificationWithPrompt;
|
|
49
|
+
/**
|
|
50
|
+
* Envelopa uma função com verificação de atualização
|
|
51
|
+
* @param commandName Nome do comando sendo executado
|
|
52
|
+
* @param originalAction Função original a ser executada
|
|
53
|
+
* @returns Promise com o resultado da função original
|
|
54
|
+
*/
|
|
55
|
+
wrap(commandName: string, originalAction: () => Promise<void>): Promise<void>;
|
|
56
|
+
private displayNotification;
|
|
57
|
+
}
|
|
58
|
+
export declare const updateNotifierMiddleware: UpdateNotifierMiddleware;
|
|
59
|
+
export {};
|