Skip to content

Commit 7191e0d

Browse files
committed
Get rid of clack's taskLog, not working reliably
Spent a lot of time on it, but could not get it to work reliably. It clears lines that it should not clear when maininging the compact n-lines view during the log stream. Replaced it with a normal log instead for now.
1 parent bf56f5a commit 7191e0d

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

packages/cli-v3/src/commands/deploy.ts

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,12 +1061,8 @@ async function handleNativeBuildServerDeploy({
10611061
case "log": {
10621062
if (record.seq_num === 0) {
10631063
$queuedSpinner.stop("Build started");
1064+
log.message("", { symbol: undefined, spacing: 0 });
10641065
queuedSpinnerStopped = true;
1065-
deploymentLog = taskLog({
1066-
title: "Deployment in progress...",
1067-
retainLog: true,
1068-
limit: isCI ? undefined : 20,
1069-
});
10701066
}
10711067

10721068
const formattedTimestamp = chalkGrey(
@@ -1082,14 +1078,14 @@ async function handleNativeBuildServerDeploy({
10821078
const { level, message } = event.data;
10831079
const formattedMessage =
10841080
level === "error"
1085-
? chalk.bold.hex("#B91C1C")(message)
1081+
? chalk.bold(chalkError(message))
10861082
: level === "warn"
10871083
? chalkWarning(message)
10881084
: level === "debug"
10891085
? chalkGrey(message)
10901086
: message;
10911087

1092-
deploymentLog?.message(`${formattedTimestamp} ${formattedMessage}`);
1088+
log.message(`${formattedTimestamp} ${formattedMessage}`, { symbol: undefined, spacing: 0 });
10931089
break;
10941090
}
10951091
case "finalized": {
@@ -1121,7 +1117,7 @@ async function handleNativeBuildServerDeploy({
11211117
}
11221118

11231119
if (!finalDeploymentEvent) {
1124-
deploymentLog?.error(
1120+
log.error(
11251121
"Stopped receiving updates from the build server, please check the deployment status in the dashboard"
11261122
);
11271123

@@ -1139,7 +1135,7 @@ async function handleNativeBuildServerDeploy({
11391135
switch (finalDeploymentEvent.result) {
11401136
case "succeeded": {
11411137
queuedSpinnerStopped
1142-
? deploymentLog?.success("Deployment completed successfully")
1138+
? log.success("Deployment completed successfully")
11431139
: $queuedSpinner.stop("Deployment completed successfully");
11441140

11451141
if (finalDeploymentEvent.message) {
@@ -1164,7 +1160,7 @@ async function handleNativeBuildServerDeploy({
11641160
}
11651161
case "failed": {
11661162
queuedSpinnerStopped
1167-
? deploymentLog?.error("Deployment failed")
1163+
? log.error("Deployment failed")
11681164
: $queuedSpinner.stop("Deployment failed");
11691165

11701166
if (finalDeploymentEvent.message) {
@@ -1178,7 +1174,7 @@ async function handleNativeBuildServerDeploy({
11781174
}
11791175
case "timed_out": {
11801176
queuedSpinnerStopped
1181-
? deploymentLog?.error("Deployment timed out")
1177+
? log.error("Deployment timed out")
11821178
: $queuedSpinner.stop("Deployment timed out");
11831179

11841180
if (finalDeploymentEvent.message) {
@@ -1192,7 +1188,7 @@ async function handleNativeBuildServerDeploy({
11921188
}
11931189
case "canceled": {
11941190
queuedSpinnerStopped
1195-
? deploymentLog?.error("Deployment was canceled")
1191+
? log.error("Deployment was canceled")
11961192
: $queuedSpinner.stop("Deployment was canceled");
11971193

11981194
if (finalDeploymentEvent.message) {
@@ -1208,7 +1204,7 @@ async function handleNativeBuildServerDeploy({
12081204
// This case is only relevant in case we extend the enum in the future.
12091205
// New enum values will not be treated as errors in older cli versions.
12101206
queuedSpinnerStopped
1211-
? deploymentLog?.success("Log stream finished")
1207+
? log.success("Log stream finished")
12121208
: $queuedSpinner.stop("Log stream finished");
12131209
if (finalDeploymentEvent.message) {
12141210
log.message(finalDeploymentEvent.message);

0 commit comments

Comments
 (0)