@danhachuel/leadmaster 0.1.1 → 0.1.2
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 +24 -0
- package/README.md +4 -3
- package/backend/main.py +21 -0
- package/frontend/dist/assets/index-0xtgAs3t.js +90 -0
- package/frontend/dist/assets/{index-CFQHp6yf.css → index-pSbjfRli.css} +1 -1
- package/frontend/dist/index.html +2 -2
- package/package.json +2 -2
- package/scripts/cli.mjs +7 -16
- package/frontend/dist/assets/index-CPq53JWx.js +0 -90
package/scripts/cli.mjs
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Comandos:
|
|
7
7
|
* install Prepara a pasta de dados (home) e instala as dependências Python.
|
|
8
|
-
* start Sobe o backend FastAPI (serving da UI construída) e
|
|
8
|
+
* start Sobe o backend FastAPI (serving da UI construída) e imprime a URL
|
|
9
|
+
* no terminal — NUNCA abre o navegador; quem abre é o usuário.
|
|
9
10
|
* `npx @danhachuel/leadmaster` sem argumentos executa este comando.
|
|
10
11
|
* doctor Diagnóstico rápido: Node, Python, dependências, pasta de dados.
|
|
11
12
|
* help Ajuda.
|
|
@@ -240,16 +241,6 @@ async function waitForHealth(port, timeoutMs) {
|
|
|
240
241
|
|
|
241
242
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
242
243
|
|
|
243
|
-
function openBrowser(url) {
|
|
244
|
-
try {
|
|
245
|
-
if (platform() === 'win32') spawn('cmd', ['/c', 'start', '', url], { detached: true, stdio: 'ignore' }).unref();
|
|
246
|
-
else if (platform() === 'darwin') spawn('open', [url], { detached: true, stdio: 'ignore' }).unref();
|
|
247
|
-
else spawn('xdg-open', [url], { detached: true, stdio: 'ignore' }).unref();
|
|
248
|
-
} catch {
|
|
249
|
-
console.log(`Abra manualmente: ${url}`);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
244
|
function portaLivre(port) {
|
|
254
245
|
return new Promise((resolve) => {
|
|
255
246
|
const server = net.createServer();
|
|
@@ -349,8 +340,7 @@ function cmdStart(args) {
|
|
|
349
340
|
}
|
|
350
341
|
const url = `http://127.0.0.1:${porta}`;
|
|
351
342
|
if (jaRodando) {
|
|
352
|
-
console.log(`ℹ LeadMaster já está rodando em ${url} —
|
|
353
|
-
openBrowser(url);
|
|
343
|
+
console.log(`ℹ LeadMaster já está rodando em ${url} — abra o endereço no navegador.`);
|
|
354
344
|
process.exit(0);
|
|
355
345
|
return;
|
|
356
346
|
}
|
|
@@ -383,7 +373,7 @@ function cmdStart(args) {
|
|
|
383
373
|
console.warn('⚠ Interface construída não encontrada (frontend/dist).');
|
|
384
374
|
}
|
|
385
375
|
|
|
386
|
-
const child = spawn(python.cmd, [...python.args, '-m', 'uvicorn', 'main:app', '--host', '127.0.0.1', '--port', String(porta)], {
|
|
376
|
+
const child = spawn(python.cmd, [...python.args, '-m', 'uvicorn', 'main:app', '--host', '127.0.0.1', '--port', String(porta), '--no-access-log'], {
|
|
387
377
|
cwd: path.join(PKG_ROOT, 'backend'),
|
|
388
378
|
env: {
|
|
389
379
|
...process.env,
|
|
@@ -432,7 +422,8 @@ function cmdStart(args) {
|
|
|
432
422
|
process.exit(1);
|
|
433
423
|
}
|
|
434
424
|
console.log(`✓ LeadMaster no ar em ${url} (dados: ${home})`);
|
|
435
|
-
|
|
425
|
+
console.log('');
|
|
426
|
+
console.log(`ℹ Abra ${url} no navegador quando quiser — o LeadMaster nunca abre janelas sozinho.`);
|
|
436
427
|
console.log('');
|
|
437
428
|
console.log('Pressione Ctrl+C para encerrar.');
|
|
438
429
|
})().catch((err) => {
|
|
@@ -473,7 +464,7 @@ function cmdHelp() {
|
|
|
473
464
|
console.log('');
|
|
474
465
|
console.log('Comandos:');
|
|
475
466
|
console.log(' install Prepara a pasta de dados e instala dependências Python.');
|
|
476
|
-
console.log(' start Sobe o servidor local e abre o navegador
|
|
467
|
+
console.log(' start Sobe o servidor local e imprime a URL no terminal (você abre o navegador).');
|
|
477
468
|
console.log(' doctor Diagnóstico do ambiente.');
|
|
478
469
|
console.log(' version Mostra a versão.');
|
|
479
470
|
console.log(' help Esta ajuda.');
|