onveloz 0.0.0-beta.21 → 0.0.0-beta.22
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/index.mjs +41 -18
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4340,6 +4340,8 @@ var BuildProgressRenderer = class {
|
|
|
4340
4340
|
spinnerText = "Aguardando início do build...";
|
|
4341
4341
|
/** External ora spinner reference — used to pause/resume during runtime log output */
|
|
4342
4342
|
externalSpinner = null;
|
|
4343
|
+
/** Pending render scheduled via setTimeout for batching rapid updates */
|
|
4344
|
+
pendingRender = null;
|
|
4343
4345
|
constructor(serviceName) {
|
|
4344
4346
|
this.serviceName = serviceName;
|
|
4345
4347
|
this.startSpinner();
|
|
@@ -4352,13 +4354,17 @@ var BuildProgressRenderer = class {
|
|
|
4352
4354
|
this.spinnerInterval = setInterval(() => {
|
|
4353
4355
|
this.spinnerFrame = (this.spinnerFrame + 1) % SPINNER_FRAMES.length;
|
|
4354
4356
|
this.render();
|
|
4355
|
-
},
|
|
4357
|
+
}, 120);
|
|
4356
4358
|
}
|
|
4357
4359
|
stopSpinner() {
|
|
4358
4360
|
if (this.spinnerInterval) {
|
|
4359
4361
|
clearInterval(this.spinnerInterval);
|
|
4360
4362
|
this.spinnerInterval = null;
|
|
4361
4363
|
}
|
|
4364
|
+
if (this.pendingRender) {
|
|
4365
|
+
clearTimeout(this.pendingRender);
|
|
4366
|
+
this.pendingRender = null;
|
|
4367
|
+
}
|
|
4362
4368
|
}
|
|
4363
4369
|
setBuilding() {
|
|
4364
4370
|
this.phase = "building";
|
|
@@ -4424,7 +4430,7 @@ var BuildProgressRenderer = class {
|
|
|
4424
4430
|
case "output":
|
|
4425
4431
|
case "other": break;
|
|
4426
4432
|
}
|
|
4427
|
-
this.
|
|
4433
|
+
this.scheduleRender();
|
|
4428
4434
|
}
|
|
4429
4435
|
printRuntimeLine(line) {
|
|
4430
4436
|
const parsed = parseBuildLine(line);
|
|
@@ -4445,18 +4451,30 @@ var BuildProgressRenderer = class {
|
|
|
4445
4451
|
isStageComplete(stage) {
|
|
4446
4452
|
return stage.steps.size >= stage.total;
|
|
4447
4453
|
}
|
|
4454
|
+
/**
|
|
4455
|
+
* Schedule a render on the next tick — batches rapid processLine() calls
|
|
4456
|
+
* so we don't re-render for every single log line in a burst.
|
|
4457
|
+
*/
|
|
4458
|
+
scheduleRender() {
|
|
4459
|
+
if (this.pendingRender) return;
|
|
4460
|
+
this.pendingRender = setTimeout(() => {
|
|
4461
|
+
this.pendingRender = null;
|
|
4462
|
+
this.render();
|
|
4463
|
+
}, 0);
|
|
4464
|
+
}
|
|
4448
4465
|
render() {
|
|
4449
|
-
|
|
4466
|
+
const buf = [];
|
|
4467
|
+
if (this.renderLineCount > 0) buf.push(`\x1b[${this.renderLineCount}A\x1b[J`);
|
|
4450
4468
|
let lines = 0;
|
|
4451
4469
|
const label = this.serviceName ? `BUILD ${chalk.dim(`(${this.serviceName})`)}` : "BUILD";
|
|
4452
|
-
|
|
4470
|
+
buf.push(`${chalk.cyan.bold(` ${label}`)}\n`);
|
|
4453
4471
|
lines++;
|
|
4454
4472
|
for (const msg of this.platformMessages) {
|
|
4455
|
-
|
|
4473
|
+
buf.push(` ${msg}\n`);
|
|
4456
4474
|
lines++;
|
|
4457
4475
|
}
|
|
4458
4476
|
if (this.stageOrder.length > 0) {
|
|
4459
|
-
|
|
4477
|
+
buf.push("\n");
|
|
4460
4478
|
lines++;
|
|
4461
4479
|
}
|
|
4462
4480
|
const maxNameLen = Math.max(...this.stageOrder.map((n) => n.length), 4);
|
|
@@ -4468,31 +4486,34 @@ var BuildProgressRenderer = class {
|
|
|
4468
4486
|
const allDone = complete && !allCached;
|
|
4469
4487
|
const bar = renderProgressBar(stage.steps.size, stage.total, allCached, allDone);
|
|
4470
4488
|
const paddedName = chalk.bold(stageName.padEnd(maxNameLen));
|
|
4471
|
-
|
|
4489
|
+
buf.push(` ${paddedName} ${bar}\n`);
|
|
4472
4490
|
lines++;
|
|
4473
4491
|
const sortedSteps = [...stage.steps.entries()].sort((a, b) => a[0] - b[0]);
|
|
4492
|
+
const spinnerChar = SPINNER_FRAMES[this.spinnerFrame];
|
|
4474
4493
|
for (const [stepNum, command] of sortedSteps) {
|
|
4475
4494
|
let stepStatus = "";
|
|
4476
4495
|
for (const [bkNum, dockerStep] of stage.stepNumMap.entries()) if (dockerStep === stepNum) {
|
|
4477
4496
|
if (stage.cachedStepNums.has(bkNum)) stepStatus = ` ${BRAND("◆")}`;
|
|
4478
4497
|
else if (stage.doneStepNums.has(bkNum)) stepStatus = ` ${chalk.green("✓")}`;
|
|
4498
|
+
else stepStatus = ` ${chalk.cyan(spinnerChar)}`;
|
|
4479
4499
|
break;
|
|
4480
4500
|
}
|
|
4481
|
-
|
|
4501
|
+
buf.push(` ${command}${stepStatus}\n`);
|
|
4482
4502
|
lines++;
|
|
4483
4503
|
}
|
|
4484
4504
|
if (i < this.stageOrder.length - 1) {
|
|
4485
|
-
|
|
4505
|
+
buf.push("\n");
|
|
4486
4506
|
lines++;
|
|
4487
4507
|
}
|
|
4488
4508
|
}
|
|
4489
4509
|
if (this.spinnerInterval) {
|
|
4490
4510
|
if (!(this.stageOrder.length > 0 && this.stageOrder.every((name) => this.isStageComplete(this.stages.get(name))))) {
|
|
4491
4511
|
const frame = SPINNER_FRAMES[this.spinnerFrame];
|
|
4492
|
-
|
|
4512
|
+
buf.push(`\n ${chalk.cyan(frame)} ${this.spinnerText}\n`);
|
|
4493
4513
|
lines += 2;
|
|
4494
4514
|
}
|
|
4495
4515
|
}
|
|
4516
|
+
process.stdout.write(buf.join(""));
|
|
4496
4517
|
this.renderLineCount = lines;
|
|
4497
4518
|
}
|
|
4498
4519
|
};
|
|
@@ -4654,7 +4675,7 @@ const LOGO_LINES = [
|
|
|
4654
4675
|
];
|
|
4655
4676
|
const BRAND_COLOR = "#FF4D00";
|
|
4656
4677
|
function getVersion() {
|
|
4657
|
-
return "0.0.0-beta.
|
|
4678
|
+
return "0.0.0-beta.22";
|
|
4658
4679
|
}
|
|
4659
4680
|
function printBanner(subtitle) {
|
|
4660
4681
|
const version = getVersion();
|
|
@@ -4927,30 +4948,32 @@ var TtyOutput = class {
|
|
|
4927
4948
|
this.prevLineCount = this.doRenderProgress(entries, this.prevLineCount);
|
|
4928
4949
|
}
|
|
4929
4950
|
doRenderProgress(progressMap, prevLineCount) {
|
|
4930
|
-
|
|
4951
|
+
const buf = [];
|
|
4952
|
+
if (prevLineCount > 0) buf.push(`\x1b[${prevLineCount}A\x1b[J`);
|
|
4931
4953
|
let lineCount = 0;
|
|
4932
4954
|
for (const [, progress] of progressMap) {
|
|
4933
4955
|
const icon = statusIcons[progress.status] || chalk.gray("○");
|
|
4934
4956
|
const label = statusLabels[progress.status] || progress.status;
|
|
4935
|
-
|
|
4957
|
+
buf.push(`${icon} ${chalk.bold(progress.serviceName)}: ${label}\n`);
|
|
4936
4958
|
lineCount++;
|
|
4937
4959
|
if (progress.status === "BUILDING" || progress.status === "BUILD_FAILED") {
|
|
4938
4960
|
const nonEmptyLines = progress.logLines.filter((l) => l.trim());
|
|
4939
4961
|
if (nonEmptyLines.length > 0) {
|
|
4940
4962
|
const tail = nonEmptyLines.slice(-3);
|
|
4941
4963
|
for (const line of tail) {
|
|
4942
|
-
|
|
4964
|
+
buf.push(` ${chalk.dim(line)}\n`);
|
|
4943
4965
|
lineCount++;
|
|
4944
4966
|
}
|
|
4945
4967
|
} else if (progress.status === "BUILDING") {
|
|
4946
|
-
|
|
4968
|
+
buf.push(` ${chalk.dim("Aguardando logs do build...")}\n`);
|
|
4947
4969
|
lineCount++;
|
|
4948
4970
|
}
|
|
4949
4971
|
} else if (progress.status === "QUEUED") {
|
|
4950
|
-
|
|
4972
|
+
buf.push(` ${chalk.dim("Na fila para compilação...")}\n`);
|
|
4951
4973
|
lineCount++;
|
|
4952
4974
|
}
|
|
4953
4975
|
}
|
|
4976
|
+
process.stdout.write(buf.join(""));
|
|
4954
4977
|
return lineCount;
|
|
4955
4978
|
}
|
|
4956
4979
|
buildStart(_serviceName) {}
|
|
@@ -5678,7 +5701,7 @@ async function autoUpdate() {
|
|
|
5678
5701
|
if (process.env.VELOZ_MCP === "true") return;
|
|
5679
5702
|
const pm = detectPackageManager();
|
|
5680
5703
|
if (!pm) return;
|
|
5681
|
-
const currentVersion = "0.0.0-beta.
|
|
5704
|
+
const currentVersion = "0.0.0-beta.22";
|
|
5682
5705
|
const latestVersion = await fetchLatestVersion();
|
|
5683
5706
|
if (!latestVersion || latestVersion === currentVersion) return;
|
|
5684
5707
|
const installCmd = getInstallCommand(pm, latestVersion);
|
|
@@ -7233,7 +7256,7 @@ async function pruneRemovedEntries(config, existingConfig, services, databases)
|
|
|
7233
7256
|
//#region src/index.ts
|
|
7234
7257
|
if (process.argv.includes("--mcp")) process.env.VELOZ_MCP = "true";
|
|
7235
7258
|
const cli = Cli.create("veloz", {
|
|
7236
|
-
version: "0.0.0-beta.
|
|
7259
|
+
version: "0.0.0-beta.22",
|
|
7237
7260
|
description: "CLI da plataforma Veloz — deploy rápido para o Brasil",
|
|
7238
7261
|
env: z.object({ VELOZ_ENV: z.string().optional().describe("Ambiente alvo (ex: preview, staging)") })
|
|
7239
7262
|
});
|