@followthecode/cli 1.2.5 → 1.2.8
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/TESTING_INSTALLATION.md +344 -0
- package/package.json +5 -7
- package/scripts/copy-config.js +33 -0
- package/TESTING.md +0 -169
- package/TROUBLESHOOTING.md +0 -60
- package/TROUBLESHOOTING_INSTALL.md +0 -212
- package/bin/win-x64/git2-c058aa8.dll +0 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
# 🧪 Guia de Teste de Instalação - FTC CLI
|
|
2
|
+
|
|
3
|
+
Este guia explica como testar a instalação do FTC CLI antes de publicar uma nova versão.
|
|
4
|
+
|
|
5
|
+
## 🎯 Objetivo
|
|
6
|
+
|
|
7
|
+
Garantir que o CLI funcione corretamente em diferentes ambientes antes da publicação, evitando problemas para os usuários.
|
|
8
|
+
|
|
9
|
+
## 📋 Pré-requisitos
|
|
10
|
+
|
|
11
|
+
Antes de executar os testes, certifique-se de ter instalado:
|
|
12
|
+
|
|
13
|
+
- **Node.js** (versão 14 ou superior)
|
|
14
|
+
- **npm** (versão 6 ou superior)
|
|
15
|
+
- **.NET 8 SDK**
|
|
16
|
+
- **Docker** (opcional, para testes Docker)
|
|
17
|
+
- **Git** (para clonar repositórios de teste)
|
|
18
|
+
|
|
19
|
+
## 🚀 Testes Automatizados
|
|
20
|
+
|
|
21
|
+
### Windows (PowerShell)
|
|
22
|
+
|
|
23
|
+
```powershell
|
|
24
|
+
# Teste básico
|
|
25
|
+
npm run test-installation
|
|
26
|
+
|
|
27
|
+
# Teste com limpeza prévia
|
|
28
|
+
npm run test-installation:clean
|
|
29
|
+
|
|
30
|
+
# Teste com output detalhado
|
|
31
|
+
npm run test-installation:verbose
|
|
32
|
+
|
|
33
|
+
# Teste pulando build (útil para testes rápidos)
|
|
34
|
+
npm run test-installation:skip-build
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Linux/macOS (Bash)
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Teste básico
|
|
41
|
+
npm run test:install:linux
|
|
42
|
+
|
|
43
|
+
# Teste WSL
|
|
44
|
+
npm run test:install:wsl
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Execução Direta dos Scripts
|
|
48
|
+
|
|
49
|
+
#### Windows
|
|
50
|
+
```powershell
|
|
51
|
+
# Executar diretamente
|
|
52
|
+
.\scripts\test-installation.ps1
|
|
53
|
+
|
|
54
|
+
# Com parâmetros
|
|
55
|
+
.\scripts\test-installation.ps1 -Clean -Verbose
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
#### Linux/macOS
|
|
59
|
+
```bash
|
|
60
|
+
# Tornar executável (se necessário)
|
|
61
|
+
chmod +x scripts/test-installation.sh
|
|
62
|
+
|
|
63
|
+
# Executar diretamente
|
|
64
|
+
./scripts/test-installation.sh
|
|
65
|
+
|
|
66
|
+
# Com parâmetros
|
|
67
|
+
./scripts/test-installation.sh --clean
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## 🧪 O que os Testes Verificam
|
|
71
|
+
|
|
72
|
+
### 1. **Pré-requisitos**
|
|
73
|
+
- ✅ Node.js instalado e funcionando
|
|
74
|
+
- ✅ npm instalado e funcionando
|
|
75
|
+
- ✅ .NET SDK instalado e funcionando
|
|
76
|
+
|
|
77
|
+
### 2. **Build do Projeto**
|
|
78
|
+
- ✅ Compilação em modo Release
|
|
79
|
+
- ✅ Publicação para diferentes plataformas
|
|
80
|
+
- ✅ Geração de binários executáveis
|
|
81
|
+
|
|
82
|
+
### 3. **Package NPM**
|
|
83
|
+
- ✅ package.json válido
|
|
84
|
+
- ✅ Dependências instaladas
|
|
85
|
+
- ✅ Scripts npm funcionando
|
|
86
|
+
- ✅ Build para Windows/Linux/macOS
|
|
87
|
+
|
|
88
|
+
### 4. **Instalação Local**
|
|
89
|
+
- ✅ Binários criados corretamente
|
|
90
|
+
- ✅ Wrapper Node.js funcionando
|
|
91
|
+
- ✅ Executável .NET funcionando
|
|
92
|
+
- ✅ Arquivos de configuração presentes
|
|
93
|
+
|
|
94
|
+
### 5. **Instalação Global Simulada**
|
|
95
|
+
- ✅ Instalação em diretório temporário
|
|
96
|
+
- ✅ Binários instalados corretamente
|
|
97
|
+
- ✅ CLI executável globalmente
|
|
98
|
+
- ✅ Permissões configuradas
|
|
99
|
+
|
|
100
|
+
### 6. **Docker**
|
|
101
|
+
- ✅ Build da imagem Docker
|
|
102
|
+
- ✅ Execução do container
|
|
103
|
+
- ✅ CLI funcionando no Docker
|
|
104
|
+
- ✅ Limpeza da imagem de teste
|
|
105
|
+
|
|
106
|
+
### 7. **Funcionalidades Básicas**
|
|
107
|
+
- ✅ Comando de ajuda funcionando
|
|
108
|
+
- ✅ Análise de repositório (se disponível)
|
|
109
|
+
- ✅ Tratamento de erros
|
|
110
|
+
|
|
111
|
+
## 📊 Interpretando os Resultados
|
|
112
|
+
|
|
113
|
+
### ✅ Todos os Testes Passaram
|
|
114
|
+
```
|
|
115
|
+
🎉 Todos os testes passaram! CLI está pronto para publicação.
|
|
116
|
+
💡 Próximos passos:
|
|
117
|
+
1. npm version patch|minor|major
|
|
118
|
+
2. npm publish
|
|
119
|
+
3. git push --tags
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### ❌ Alguns Testes Falharam
|
|
123
|
+
```
|
|
124
|
+
❌ Alguns testes falharam. Corrija os problemas antes de publicar.
|
|
125
|
+
💡 Verifique os logs acima para identificar os problemas.
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## 🔧 Solução de Problemas Comuns
|
|
129
|
+
|
|
130
|
+
### Build Falhou
|
|
131
|
+
```bash
|
|
132
|
+
# Verificar versão do .NET
|
|
133
|
+
dotnet --version
|
|
134
|
+
|
|
135
|
+
# Limpar cache
|
|
136
|
+
dotnet clean
|
|
137
|
+
dotnet restore
|
|
138
|
+
|
|
139
|
+
# Tentar build novamente
|
|
140
|
+
dotnet build --configuration Release
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### NPM Scripts Falharam
|
|
144
|
+
```bash
|
|
145
|
+
# Limpar node_modules
|
|
146
|
+
rm -rf node_modules package-lock.json
|
|
147
|
+
|
|
148
|
+
# Reinstalar dependências
|
|
149
|
+
npm install
|
|
150
|
+
|
|
151
|
+
# Verificar scripts
|
|
152
|
+
npm run build:win
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Docker Falhou
|
|
156
|
+
```bash
|
|
157
|
+
# Verificar se Docker está rodando
|
|
158
|
+
docker --version
|
|
159
|
+
docker ps
|
|
160
|
+
|
|
161
|
+
# Limpar imagens antigas
|
|
162
|
+
docker system prune -f
|
|
163
|
+
|
|
164
|
+
# Tentar build novamente
|
|
165
|
+
docker build -t ftc:test .
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Permissões no Linux/macOS
|
|
169
|
+
```bash
|
|
170
|
+
# Definir permissões manualmente
|
|
171
|
+
chmod +x bin/ftc
|
|
172
|
+
chmod +x bin/linux-x64/ftc.cli
|
|
173
|
+
|
|
174
|
+
# Verificar permissões
|
|
175
|
+
ls -la bin/
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## 🧪 Testes Manuais Adicionais
|
|
179
|
+
|
|
180
|
+
### 1. **Teste com Repositório Real**
|
|
181
|
+
|
|
182
|
+
Crie um repositório de teste:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# Criar repositório de teste
|
|
186
|
+
mkdir test-repo
|
|
187
|
+
cd test-repo
|
|
188
|
+
git init
|
|
189
|
+
echo "# Test Repository" > README.md
|
|
190
|
+
git add README.md
|
|
191
|
+
git commit -m "Initial commit"
|
|
192
|
+
cd ..
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Execute o CLI:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# Testar análise
|
|
199
|
+
bin/ftc collect code ./test-repo --json
|
|
200
|
+
|
|
201
|
+
# Testar com filtros
|
|
202
|
+
bin/ftc collect code ./test-repo --startDate 2024-01-01 --json
|
|
203
|
+
|
|
204
|
+
# Testar exportação
|
|
205
|
+
bin/ftc collect code ./test-repo --csv --export local:./resultado.csv
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### 2. **Teste com Repositório Remoto**
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
# Testar com GitHub
|
|
212
|
+
bin/ftc collect code https://github.com/microsoft/vscode.git --json
|
|
213
|
+
|
|
214
|
+
# Testar com filtros
|
|
215
|
+
bin/ftc collect code https://github.com/microsoft/vscode.git --startDate 2024-01-01 --endDate 2024-12-31 --json
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### 3. **Teste de Instalação Global Real**
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
# Instalar globalmente (em ambiente de teste)
|
|
222
|
+
npm install -g .
|
|
223
|
+
|
|
224
|
+
# Verificar instalação
|
|
225
|
+
ftc --version
|
|
226
|
+
ftc --help
|
|
227
|
+
|
|
228
|
+
# Testar funcionalidade
|
|
229
|
+
ftc collect code ./test-repo --json
|
|
230
|
+
|
|
231
|
+
# Desinstalar
|
|
232
|
+
npm uninstall -g @followthecode/cli
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### 4. **Teste de Docker Real**
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
# Build da imagem
|
|
239
|
+
docker build -t ftc:latest .
|
|
240
|
+
|
|
241
|
+
# Testar com repositório local
|
|
242
|
+
docker run --rm -v "$PWD:/repo" ftc:latest collect code "/repo/test-repo" --json
|
|
243
|
+
|
|
244
|
+
# Testar com repositório remoto
|
|
245
|
+
docker run --rm ftc:latest collect code "https://github.com/microsoft/vscode.git" --json
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## 🔄 Workflow de Teste Completo
|
|
249
|
+
|
|
250
|
+
### 1. **Preparação**
|
|
251
|
+
```bash
|
|
252
|
+
# Limpar builds anteriores
|
|
253
|
+
npm run clean
|
|
254
|
+
rm -rf bin/ node_modules/
|
|
255
|
+
|
|
256
|
+
# Instalar dependências
|
|
257
|
+
npm install
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### 2. **Testes Automatizados**
|
|
261
|
+
```bash
|
|
262
|
+
# Windows
|
|
263
|
+
npm run test-installation:clean
|
|
264
|
+
|
|
265
|
+
# Linux/macOS
|
|
266
|
+
npm run test-installation:linux:clean
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### 3. **Testes Manuais**
|
|
270
|
+
```bash
|
|
271
|
+
# Criar repositório de teste
|
|
272
|
+
mkdir test-repo && cd test-repo
|
|
273
|
+
git init && echo "# Test" > README.md
|
|
274
|
+
git add . && git commit -m "Initial"
|
|
275
|
+
cd ..
|
|
276
|
+
|
|
277
|
+
# Testar funcionalidades
|
|
278
|
+
bin/ftc collect code ./test-repo --json
|
|
279
|
+
bin/ftc collect code ./test-repo --csv
|
|
280
|
+
bin/ftc collect code https://github.com/microsoft/vscode.git --json
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### 4. **Teste de Instalação Global**
|
|
284
|
+
```bash
|
|
285
|
+
# Instalar globalmente
|
|
286
|
+
npm install -g .
|
|
287
|
+
|
|
288
|
+
# Testar
|
|
289
|
+
ftc --version
|
|
290
|
+
ftc collect code ./test-repo --json
|
|
291
|
+
|
|
292
|
+
# Desinstalar
|
|
293
|
+
npm uninstall -g @followthecode/cli
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### 5. **Teste Docker**
|
|
297
|
+
```bash
|
|
298
|
+
# Build e teste
|
|
299
|
+
docker build -t ftc:test .
|
|
300
|
+
docker run --rm ftc:test --help
|
|
301
|
+
docker run --rm -v "$PWD:/repo" ftc:test collect code "/repo/test-repo" --json
|
|
302
|
+
docker rmi ftc:test
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## 📝 Checklist de Publicação
|
|
306
|
+
|
|
307
|
+
Antes de publicar, confirme que:
|
|
308
|
+
|
|
309
|
+
- [ ] Todos os testes automatizados passaram
|
|
310
|
+
- [ ] Testes manuais com repositório real funcionaram
|
|
311
|
+
- [ ] Instalação global funciona corretamente
|
|
312
|
+
- [ ] Docker build e execução funcionam
|
|
313
|
+
- [ ] Versão no package.json foi atualizada
|
|
314
|
+
- [ ] Changelog foi atualizado
|
|
315
|
+
- [ ] Documentação está atualizada
|
|
316
|
+
- [ ] Commits foram feitos e tags criadas
|
|
317
|
+
|
|
318
|
+
## 🚨 Problemas Conhecidos
|
|
319
|
+
|
|
320
|
+
### Windows
|
|
321
|
+
- **Problema**: Scripts PowerShell podem ser bloqueados
|
|
322
|
+
- **Solução**: Executar `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser`
|
|
323
|
+
|
|
324
|
+
### Linux/macOS
|
|
325
|
+
- **Problema**: Permissões de execução não definidas
|
|
326
|
+
- **Solução**: Executar `chmod +x scripts/test-installation.sh`
|
|
327
|
+
|
|
328
|
+
### Docker
|
|
329
|
+
- **Problema**: Imagens antigas podem causar conflitos
|
|
330
|
+
- **Solução**: Executar `docker system prune -f` antes dos testes
|
|
331
|
+
|
|
332
|
+
## 📞 Suporte
|
|
333
|
+
|
|
334
|
+
Se encontrar problemas durante os testes:
|
|
335
|
+
|
|
336
|
+
1. **Verificar logs** detalhados com `-Verbose`
|
|
337
|
+
2. **Executar testes individuais** para isolar problemas
|
|
338
|
+
3. **Verificar pré-requisitos** e versões
|
|
339
|
+
4. **Consultar troubleshooting** em `TROUBLESHOOTING_INSTALL.md`
|
|
340
|
+
5. **Reportar issues** com logs completos
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
**💡 Dica**: Execute os testes em um ambiente limpo (máquina virtual ou container) para simular a experiência real do usuário.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@followthecode/cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"description": "CLI tool for Git repository analysis and data collection",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"ftc-linux": "./bin/ftc"
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
|
-
"prepublishOnly": "npm run build",
|
|
16
15
|
"build": "npm run build:all && npm run setup",
|
|
17
16
|
"build:all": "npm run build:win && npm run build:mac && npm run build:linux",
|
|
18
17
|
"build:win": "dotnet publish ftc.cli.csproj -c Release -r win-x64 -o ./bin/win-x64",
|
|
@@ -21,7 +20,7 @@
|
|
|
21
20
|
"setup": "npm run copy-config && npm run set-permissions",
|
|
22
21
|
"copy-config": "node scripts/copy-config.js",
|
|
23
22
|
"set-permissions": "node scripts/set-permissions.js",
|
|
24
|
-
"postinstall": "
|
|
23
|
+
"postinstall": "node scripts/install-wrapper.js",
|
|
25
24
|
"test": "dotnet test",
|
|
26
25
|
"test:install": "npm run test:install:win",
|
|
27
26
|
"test:install:win": "powershell -ExecutionPolicy Bypass -File scripts/test-simple.ps1",
|
|
@@ -76,14 +75,13 @@
|
|
|
76
75
|
"bin/linux-x64/ftc.cli",
|
|
77
76
|
"bin/linux-x64/appsettings.json",
|
|
78
77
|
"bin/linux-x64/libgit2-c058aa8.so",
|
|
78
|
+
"scripts/copy-config.js",
|
|
79
79
|
"scripts/set-permissions.js",
|
|
80
|
-
"scripts/fix-permissions.js",
|
|
81
80
|
"scripts/install-wrapper.js",
|
|
81
|
+
"scripts/README.md",
|
|
82
82
|
"README.md",
|
|
83
83
|
"LICENSE",
|
|
84
|
-
"
|
|
85
|
-
"TROUBLESHOOTING_INSTALL.md",
|
|
86
|
-
"TESTING.md"
|
|
84
|
+
"TESTING_INSTALLATION.md"
|
|
87
85
|
],
|
|
88
86
|
"dependencies": {
|
|
89
87
|
"node-fetch": "^3.3.0"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
console.log('📋 Copiando arquivo de configuração...');
|
|
5
|
+
|
|
6
|
+
const configFile = 'appsettings.json';
|
|
7
|
+
const platforms = ['win-x64', 'osx-x64', 'linux-x64'];
|
|
8
|
+
|
|
9
|
+
// Verifica se o arquivo de configuração existe
|
|
10
|
+
if (!fs.existsSync(configFile)) {
|
|
11
|
+
console.error(`❌ Arquivo de configuração não encontrado: ${configFile}`);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Copia o arquivo para cada plataforma
|
|
16
|
+
platforms.forEach(platform => {
|
|
17
|
+
const targetDir = path.join('bin', platform);
|
|
18
|
+
const targetFile = path.join(targetDir, configFile);
|
|
19
|
+
|
|
20
|
+
// Cria o diretório se não existir
|
|
21
|
+
if (!fs.existsSync(targetDir)) {
|
|
22
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
try {
|
|
26
|
+
fs.copyFileSync(configFile, targetFile);
|
|
27
|
+
console.log(`✅ Copiado para ${targetFile}`);
|
|
28
|
+
} catch (error) {
|
|
29
|
+
console.error(`❌ Erro ao copiar para ${targetFile}:`, error.message);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
console.log('✅ Arquivo de configuração copiado para todas as plataformas');
|
package/TESTING.md
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
# 🧪 Guia de Testes - Follow The Code CLI
|
|
2
|
-
|
|
3
|
-
## Testes de Permissões
|
|
4
|
-
|
|
5
|
-
### 1. **Teste Básico de Permissões**
|
|
6
|
-
```bash
|
|
7
|
-
cd contexts/ftc.cli
|
|
8
|
-
npm run test-permissions
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Este comando verifica:
|
|
12
|
-
- ✅ Permissões dos arquivos executáveis
|
|
13
|
-
- ✅ Existência dos arquivos
|
|
14
|
-
- ✅ Funcionamento dos scripts de correção
|
|
15
|
-
|
|
16
|
-
### 2. **Teste Completo do Build**
|
|
17
|
-
```bash
|
|
18
|
-
npm run build
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Verifica todo o processo:
|
|
22
|
-
- 🔨 Compilação para todas as plataformas
|
|
23
|
-
- 📋 Cópia de configurações
|
|
24
|
-
- 🔐 Definição de permissões
|
|
25
|
-
|
|
26
|
-
### 3. **Teste Individual dos Scripts**
|
|
27
|
-
```bash
|
|
28
|
-
# Teste de cópia de configuração
|
|
29
|
-
npm run copy-config
|
|
30
|
-
|
|
31
|
-
# Teste de definição de permissões
|
|
32
|
-
npm run set-permissions
|
|
33
|
-
|
|
34
|
-
# Teste de correção manual
|
|
35
|
-
npm run fix-permissions
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### 4. **Teste com Docker (Linux)**
|
|
39
|
-
```bash
|
|
40
|
-
# Requer Docker instalado
|
|
41
|
-
npm run test-linux
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Simula instalação em ambiente Linux limpo.
|
|
45
|
-
|
|
46
|
-
## Verificação Manual
|
|
47
|
-
|
|
48
|
-
### Verificar Permissões
|
|
49
|
-
```bash
|
|
50
|
-
# Linux/macOS
|
|
51
|
-
ls -la bin/linux-x64/ftc.cli
|
|
52
|
-
ls -la bin/osx-x64/ftc.cli
|
|
53
|
-
ls -la bin/ftc.js
|
|
54
|
-
|
|
55
|
-
# Deve mostrar: -rwxr-xr-x (755)
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
### Testar Execução
|
|
59
|
-
```bash
|
|
60
|
-
# Teste do CLI
|
|
61
|
-
./bin/ftc.js --help
|
|
62
|
-
|
|
63
|
-
# Deve mostrar a ajuda do CLI
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## Teste de Publicação
|
|
67
|
-
|
|
68
|
-
### 1. **Teste Local de Publicação**
|
|
69
|
-
```bash
|
|
70
|
-
# Simula publicação sem enviar para npm
|
|
71
|
-
npm run build
|
|
72
|
-
npm pack
|
|
73
|
-
|
|
74
|
-
# Verifica o conteúdo do pacote
|
|
75
|
-
tar -tzf followthecode-cli-*.tgz
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### 2. **Teste de Instalação Local**
|
|
79
|
-
```bash
|
|
80
|
-
# Instala o pacote localmente
|
|
81
|
-
npm install -g ./followthecode-cli-*.tgz
|
|
82
|
-
|
|
83
|
-
# Testa a instalação
|
|
84
|
-
ftc --help
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## Cenários de Teste
|
|
88
|
-
|
|
89
|
-
### ✅ **Cenário 1: Build Completo**
|
|
90
|
-
1. Execute `npm run build`
|
|
91
|
-
2. Verifique se todos os arquivos foram criados
|
|
92
|
-
3. Verifique permissões com `npm run test-permissions`
|
|
93
|
-
|
|
94
|
-
### ✅ **Cenário 2: Instalação Limpa**
|
|
95
|
-
1. Delete a pasta `bin/`
|
|
96
|
-
2. Execute `npm run build`
|
|
97
|
-
3. Verifique se as permissões foram definidas
|
|
98
|
-
|
|
99
|
-
### ✅ **Cenário 3: Correção Manual**
|
|
100
|
-
1. Remova permissões: `chmod -x bin/linux-x64/ftc.cli`
|
|
101
|
-
2. Execute `npm run fix-permissions`
|
|
102
|
-
3. Verifique se as permissões foram restauradas
|
|
103
|
-
|
|
104
|
-
### ✅ **Cenário 4: Teste Cross-Platform**
|
|
105
|
-
1. Execute em Windows
|
|
106
|
-
2. Execute em Linux (via Docker)
|
|
107
|
-
3. Execute em macOS (se disponível)
|
|
108
|
-
|
|
109
|
-
## Resultados Esperados
|
|
110
|
-
|
|
111
|
-
### ✅ **Sucesso**
|
|
112
|
-
```
|
|
113
|
-
🧪 Testando permissões de execução...
|
|
114
|
-
|
|
115
|
-
🔍 Verificando arquivos...
|
|
116
|
-
|
|
117
|
-
📁 bin/ftc.js
|
|
118
|
-
Permissões: 755
|
|
119
|
-
Executável: ✅ Sim
|
|
120
|
-
Tamanho: 2048 bytes
|
|
121
|
-
|
|
122
|
-
📁 bin/linux-x64/ftc.cli
|
|
123
|
-
Permissões: 755
|
|
124
|
-
Executável: ✅ Sim
|
|
125
|
-
Tamanho: 51200 bytes
|
|
126
|
-
|
|
127
|
-
📊 Resultado do teste:
|
|
128
|
-
✅ Todas as permissões estão corretas!
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### ❌ **Falha**
|
|
132
|
-
```
|
|
133
|
-
📁 bin/linux-x64/ftc.cli
|
|
134
|
-
Permissões: 644
|
|
135
|
-
Executável: ❌ Não
|
|
136
|
-
Tamanho: 51200 bytes
|
|
137
|
-
|
|
138
|
-
📊 Resultado do teste:
|
|
139
|
-
❌ Algumas permissões precisam ser corrigidas
|
|
140
|
-
💡 Execute: npm run fix-permissions
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
## Troubleshooting
|
|
144
|
-
|
|
145
|
-
### Problema: "Script não encontrado"
|
|
146
|
-
```bash
|
|
147
|
-
# Verifique se os scripts existem
|
|
148
|
-
ls -la scripts/
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### Problema: "Permissão negada"
|
|
152
|
-
```bash
|
|
153
|
-
# No Linux/macOS
|
|
154
|
-
chmod +x scripts/*.js
|
|
155
|
-
chmod +x scripts/*.sh
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Problema: "Docker não encontrado"
|
|
159
|
-
```bash
|
|
160
|
-
# Instale Docker ou use apenas os testes Node.js
|
|
161
|
-
npm run test-permissions
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
## Próximos Passos
|
|
165
|
-
|
|
166
|
-
Após os testes:
|
|
167
|
-
1. ✅ Se tudo passar: Pronto para publicação
|
|
168
|
-
2. ❌ Se houver falhas: Corrija e teste novamente
|
|
169
|
-
3. 🔄 Para publicação: `npm run publish:patch`
|
package/TROUBLESHOOTING.md
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# 🔧 Troubleshooting - Follow The Code CLI
|
|
2
|
-
|
|
3
|
-
## Problemas de Permissão no Linux
|
|
4
|
-
|
|
5
|
-
### Sintoma
|
|
6
|
-
Após instalar a CLI no Linux, você recebe um erro como:
|
|
7
|
-
```
|
|
8
|
-
bash: ./ftc.cli: Permission denied
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
### Solução Automática
|
|
12
|
-
Execute o comando de correção de permissões:
|
|
13
|
-
```bash
|
|
14
|
-
npm run fix-permissions
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
### Solução Manual
|
|
18
|
-
Se a solução automática não funcionar, execute manualmente:
|
|
19
|
-
```bash
|
|
20
|
-
chmod +x bin/linux-x64/ftc.cli
|
|
21
|
-
chmod +x bin/ftc.js
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### Verificação
|
|
25
|
-
Para verificar se as permissões estão corretas:
|
|
26
|
-
```bash
|
|
27
|
-
ls -la bin/linux-x64/ftc.cli
|
|
28
|
-
ls -la bin/ftc.js
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
As permissões devem aparecer como `-rwxr-xr-x` (755).
|
|
32
|
-
|
|
33
|
-
## Outros Problemas Comuns
|
|
34
|
-
|
|
35
|
-
### Erro: "Executável .NET não encontrado"
|
|
36
|
-
Certifique-se de que o projeto foi compilado para todas as plataformas:
|
|
37
|
-
```bash
|
|
38
|
-
npm run build
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### Erro: "Plataforma não suportada"
|
|
42
|
-
A CLI suporta apenas:
|
|
43
|
-
- Windows (x64)
|
|
44
|
-
- macOS (x64)
|
|
45
|
-
- Linux (x64)
|
|
46
|
-
|
|
47
|
-
### Problemas de Rede
|
|
48
|
-
Se houver problemas de conectividade, verifique:
|
|
49
|
-
- Configuração de proxy
|
|
50
|
-
- Firewall
|
|
51
|
-
- DNS
|
|
52
|
-
|
|
53
|
-
## Logs de Debug
|
|
54
|
-
Para obter mais informações sobre erros, execute:
|
|
55
|
-
```bash
|
|
56
|
-
ftc --help
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## Suporte
|
|
60
|
-
Se os problemas persistirem, abra uma issue no repositório do projeto.
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
# 🔧 Troubleshooting - Problemas de Instalação do FTC CLI
|
|
2
|
-
|
|
3
|
-
## ⚠️ Problemas Comuns e Soluções
|
|
4
|
-
|
|
5
|
-
### 1. Aviso sobre `node-domexception` deprecado
|
|
6
|
-
|
|
7
|
-
**Problema:**
|
|
8
|
-
```
|
|
9
|
-
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
**Causa:** Dependência transitiva do `node-fetch` que usa uma versão antiga do `node-domexception`.
|
|
13
|
-
|
|
14
|
-
**Solução:** Este é apenas um aviso e não afeta a funcionalidade. O CLI continuará funcionando normalmente.
|
|
15
|
-
|
|
16
|
-
**Para resolver (opcional):**
|
|
17
|
-
```bash
|
|
18
|
-
# Limpar cache do npm
|
|
19
|
-
npm cache clean --force
|
|
20
|
-
|
|
21
|
-
# Reinstalar com --legacy-peer-deps se necessário
|
|
22
|
-
npm install -g @followthecode/cli --legacy-peer-deps
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### 2. Erro de Permissão EPERM no Windows
|
|
26
|
-
|
|
27
|
-
**Problema:**
|
|
28
|
-
```
|
|
29
|
-
npm warn cleanup Failed to remove some directories [
|
|
30
|
-
'C:\Users\user\AppData\Roaming\npm\node_modules\@followthecode\cli\node_modules\web-streams-polyfill\dist'
|
|
31
|
-
]
|
|
32
|
-
Error: EPERM: operation not permitted
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
**Causas:**
|
|
36
|
-
- Processos em execução usando os arquivos
|
|
37
|
-
- Antivírus bloqueando operações
|
|
38
|
-
- Permissões insuficientes
|
|
39
|
-
- Arquivos travados pelo sistema
|
|
40
|
-
|
|
41
|
-
**Soluções:**
|
|
42
|
-
|
|
43
|
-
#### Solução 1: Fechar processos e limpar
|
|
44
|
-
```bash
|
|
45
|
-
# Fechar todos os terminais/prompts abertos
|
|
46
|
-
# Fechar editores de código que possam estar usando o CLI
|
|
47
|
-
|
|
48
|
-
# Limpar cache do npm
|
|
49
|
-
npm cache clean --force
|
|
50
|
-
|
|
51
|
-
# Desinstalar e reinstalar
|
|
52
|
-
npm uninstall -g @followthecode/cli
|
|
53
|
-
npm install -g @followthecode/cli
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
#### Solução 2: Executar como Administrador
|
|
57
|
-
```bash
|
|
58
|
-
# Abrir PowerShell/CMD como Administrador
|
|
59
|
-
# Executar a instalação
|
|
60
|
-
npm install -g @followthecode/cli
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
#### Solução 3: Usar caminho alternativo
|
|
64
|
-
```bash
|
|
65
|
-
# Instalar em diretório local do usuário
|
|
66
|
-
npm install -g @followthecode/cli --prefix %USERPROFILE%\AppData\Roaming\npm
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
#### Solução 4: Desabilitar temporariamente o antivírus
|
|
70
|
-
1. Desabilitar temporariamente o antivírus
|
|
71
|
-
2. Executar a instalação
|
|
72
|
-
3. Reabilitar o antivírus
|
|
73
|
-
4. Adicionar exceção para o diretório npm se necessário
|
|
74
|
-
|
|
75
|
-
### 3. Problemas de Permissão no Linux/macOS
|
|
76
|
-
|
|
77
|
-
**Problema:** Wrapper não tem permissão de execução
|
|
78
|
-
|
|
79
|
-
**Solução:**
|
|
80
|
-
```bash
|
|
81
|
-
# Verificar permissões
|
|
82
|
-
ls -la $(which ftc)
|
|
83
|
-
|
|
84
|
-
# Definir permissões manualmente
|
|
85
|
-
chmod +x $(which ftc)
|
|
86
|
-
|
|
87
|
-
# Ou reinstalar com sudo
|
|
88
|
-
sudo npm install -g @followthecode/cli
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### 4. Node.js não encontrado
|
|
92
|
-
|
|
93
|
-
**Problema:** CLI não consegue executar o wrapper Node.js
|
|
94
|
-
|
|
95
|
-
**Solução:**
|
|
96
|
-
```bash
|
|
97
|
-
# Verificar se Node.js está instalado
|
|
98
|
-
node --version
|
|
99
|
-
|
|
100
|
-
# Se não estiver instalado, instalar Node.js
|
|
101
|
-
# Windows: https://nodejs.org/
|
|
102
|
-
# Linux: sudo apt install nodejs npm
|
|
103
|
-
# macOS: brew install node
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### 5. Problemas de Rede/Proxy
|
|
107
|
-
|
|
108
|
-
**Problema:** Falha ao baixar dependências
|
|
109
|
-
|
|
110
|
-
**Solução:**
|
|
111
|
-
```bash
|
|
112
|
-
# Configurar proxy se necessário
|
|
113
|
-
npm config set proxy http://proxy.company.com:8080
|
|
114
|
-
npm config set https-proxy http://proxy.company.com:8080
|
|
115
|
-
|
|
116
|
-
# Ou usar registry alternativo
|
|
117
|
-
npm config set registry https://registry.npmjs.org/
|
|
118
|
-
|
|
119
|
-
# Instalar com timeout aumentado
|
|
120
|
-
npm install -g @followthecode/cli --timeout=60000
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
## 🔍 Verificação da Instalação
|
|
124
|
-
|
|
125
|
-
### Teste Básico
|
|
126
|
-
```bash
|
|
127
|
-
# Verificar se o CLI foi instalado
|
|
128
|
-
ftc --version
|
|
129
|
-
|
|
130
|
-
# Verificar se o wrapper está funcionando
|
|
131
|
-
ftc --help
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### Teste de Funcionalidade
|
|
135
|
-
```bash
|
|
136
|
-
# Testar análise de repositório
|
|
137
|
-
ftc analyze --help
|
|
138
|
-
|
|
139
|
-
# Testar exportação
|
|
140
|
-
ftc export --help
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
## 🛠️ Comandos de Diagnóstico
|
|
144
|
-
|
|
145
|
-
### Verificar Instalação
|
|
146
|
-
```bash
|
|
147
|
-
# Verificar onde o CLI foi instalado
|
|
148
|
-
npm list -g @followthecode/cli
|
|
149
|
-
|
|
150
|
-
# Verificar binários disponíveis
|
|
151
|
-
where ftc # Windows
|
|
152
|
-
which ftc # Linux/macOS
|
|
153
|
-
|
|
154
|
-
# Verificar permissões dos arquivos
|
|
155
|
-
ls -la $(which ftc) # Linux/macOS
|
|
156
|
-
dir $(where ftc) # Windows
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
### Limpeza Completa
|
|
160
|
-
```bash
|
|
161
|
-
# Desinstalar completamente
|
|
162
|
-
npm uninstall -g @followthecode/cli
|
|
163
|
-
|
|
164
|
-
# Limpar cache
|
|
165
|
-
npm cache clean --force
|
|
166
|
-
|
|
167
|
-
# Remover diretórios residuais (Windows)
|
|
168
|
-
rmdir /s /q "%USERPROFILE%\AppData\Roaming\npm\node_modules\@followthecode"
|
|
169
|
-
|
|
170
|
-
# Reinstalar
|
|
171
|
-
npm install -g @followthecode/cli
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
## 📞 Suporte
|
|
175
|
-
|
|
176
|
-
Se os problemas persistirem:
|
|
177
|
-
|
|
178
|
-
1. **Coletar informações:**
|
|
179
|
-
```bash
|
|
180
|
-
node --version
|
|
181
|
-
npm --version
|
|
182
|
-
ftc --version
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
2. **Verificar logs:**
|
|
186
|
-
- Windows: `%USERPROFILE%\AppData\Roaming\npm-cache\_logs\`
|
|
187
|
-
- Linux/macOS: `~/.npm/_logs/`
|
|
188
|
-
|
|
189
|
-
3. **Reportar issue** com:
|
|
190
|
-
- Sistema operacional e versão
|
|
191
|
-
- Versões do Node.js e npm
|
|
192
|
-
- Logs de erro completos
|
|
193
|
-
- Passos para reproduzir o problema
|
|
194
|
-
|
|
195
|
-
## 🔄 Alternativas de Instalação
|
|
196
|
-
|
|
197
|
-
### Usando npx (sem instalação global)
|
|
198
|
-
```bash
|
|
199
|
-
npx @followthecode/cli analyze --help
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
### Instalação Local
|
|
203
|
-
```bash
|
|
204
|
-
# Em um projeto específico
|
|
205
|
-
npm install @followthecode/cli
|
|
206
|
-
npx ftc --help
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
### Docker (se disponível)
|
|
210
|
-
```bash
|
|
211
|
-
docker run followthecode/cli --help
|
|
212
|
-
```
|
|
Binary file
|