|
1 | 1 | import { isAgent } from "../../mode.ts"; |
2 | 2 | import { NEXT_STEPS } from "../../lib/next-steps.ts"; |
3 | | -import { isInsideGutter, log, setPrefixTone, type PrefixTone } from "../../lib/log.ts"; |
| 3 | +import { isInsideGutter, log } from "../../lib/log.ts"; |
4 | 4 | import { sleep } from "../../lib/sleep.ts"; |
5 | 5 | import { bar, intro, outro, withSpinner } from "../../lib/spinner.ts"; |
6 | 6 | import { |
@@ -165,30 +165,29 @@ export async function deploy(options: DeployOptions = {}) { |
165 | 165 | setLogLevel("debug"); |
166 | 166 | } |
167 | 167 |
|
168 | | - intro("clerk deploy", { tone: "active" }); |
| 168 | + intro("clerk deploy"); |
169 | 169 | try { |
170 | 170 | const ctx = await resolveDeployContext(options); |
171 | 171 | await runDeploy(ctx); |
172 | 172 | } catch (error) { |
173 | 173 | if (error instanceof DeployPausedError && isInsideGutter()) { |
174 | | - closeDeployGutter("error", "Paused"); |
| 174 | + closeDeployGutter("Paused"); |
175 | 175 | } |
176 | 176 | if (isPromptExitError(error) && isInsideGutter()) { |
177 | | - closeDeployGutter("cancel", "Cancelled"); |
| 177 | + closeDeployGutter("Cancelled"); |
178 | 178 | throw new UserAbortError(); |
179 | 179 | } |
180 | 180 | throw error; |
181 | 181 | } finally { |
182 | 182 | // Successful and paused paths call outro themselves. This balances the |
183 | 183 | // intro gutter if an unexpected error escapes. |
184 | 184 | if (isInsideGutter()) { |
185 | | - closeDeployGutter("error", "Failed"); |
| 185 | + closeDeployGutter("Failed"); |
186 | 186 | } |
187 | 187 | } |
188 | 188 | } |
189 | 189 |
|
190 | | -function closeDeployGutter(tone: PrefixTone, messageOrSteps: string | readonly string[]): void { |
191 | | - setPrefixTone(tone); |
| 190 | +function closeDeployGutter(messageOrSteps: string | readonly string[]): void { |
192 | 191 | outro(messageOrSteps); |
193 | 192 | } |
194 | 193 |
|
@@ -318,7 +317,7 @@ async function runDeploy(ctx: DeployContext): Promise<void> { |
318 | 317 | "No Clerk project linked to this directory. Run `clerk link`, then rerun `clerk deploy`.", |
319 | 318 | ); |
320 | 319 | log.blank(); |
321 | | - closeDeployGutter("error", "Link required"); |
| 320 | + closeDeployGutter("Link required"); |
322 | 321 | return; |
323 | 322 | } |
324 | 323 |
|
@@ -357,7 +356,7 @@ async function startNewDeploy(ctx: DeployContext): Promise<void> { |
357 | 356 | const proceed = await confirmProceed(); |
358 | 357 | if (!proceed) { |
359 | 358 | log.info("No changes were made."); |
360 | | - closeDeployGutter("cancel", "Cancelled"); |
| 359 | + closeDeployGutter("Cancelled"); |
361 | 360 | return; |
362 | 361 | } |
363 | 362 |
|
@@ -415,7 +414,7 @@ async function reconcileExistingDeploy(ctx: DeployContext): Promise<void> { |
415 | 414 | log.info("A production instance exists, but Clerk did not return a production domain yet."); |
416 | 415 | log.info("Run `clerk deploy` again after the domain is available from the API."); |
417 | 416 | log.blank(); |
418 | | - closeDeployGutter("neutral", "No deploy actions available"); |
| 417 | + closeDeployGutter("No deploy actions available"); |
419 | 418 | return; |
420 | 419 | } |
421 | 420 |
|
@@ -708,7 +707,7 @@ async function confirmProductionInstanceCreation( |
708 | 707 | log.blank(); |
709 | 708 | log.info("No production instance was created."); |
710 | 709 | log.blank(); |
711 | | - closeDeployGutter("cancel", "Cancelled"); |
| 710 | + closeDeployGutter("Cancelled"); |
712 | 711 | return false; |
713 | 712 | } |
714 | 713 |
|
@@ -736,7 +735,7 @@ async function runDnsSetup( |
736 | 735 | log.blank(); |
737 | 736 | log.info(pausedOperationNotice()); |
738 | 737 | log.blank(); |
739 | | - closeDeployGutter("error", "Paused"); |
| 738 | + closeDeployGutter("Paused"); |
740 | 739 | return false; |
741 | 740 | } |
742 | 741 | return await runDnsVerification(ctx, { ...state, cnameTargets }); |
@@ -857,7 +856,7 @@ async function runOAuthSetup( |
857 | 856 | log.blank(); |
858 | 857 | log.info(pausedOperationNotice()); |
859 | 858 | log.blank(); |
860 | | - closeDeployGutter("error", "Paused"); |
| 859 | + closeDeployGutter("Paused"); |
861 | 860 | return [...completed]; |
862 | 861 | } |
863 | 862 | } catch (error) { |
@@ -950,7 +949,7 @@ async function finishDeploy( |
950 | 949 | log.blank(); |
951 | 950 | printNextSteps(); |
952 | 951 | log.blank(); |
953 | | - closeDeployGutter("success", NEXT_STEPS.DEPLOY); |
| 952 | + closeDeployGutter(NEXT_STEPS.DEPLOY); |
954 | 953 | } |
955 | 954 |
|
956 | 955 | function printNextSteps(): void { |
|
0 commit comments