|
1 | 1 | import path from "node:path"; |
2 | | -import { spinner } from "@clack/prompts"; |
3 | 2 | import { consola } from "consola"; |
4 | 3 | import { $ } from "bun"; |
5 | 4 | import fs from "fs-extra"; |
6 | 5 | import pc from "picocolors"; |
7 | 6 | import type { ProjectConfig } from "../../types"; |
8 | 7 | import { addPackageDependency } from "../../utils/add-package-deps"; |
9 | 8 | import { getPackageExecutionCommand } from "../../utils/package-runner"; |
| 9 | +import { log } from "../../utils/logger"; |
10 | 10 |
|
11 | 11 | export async function setupTauri(config: ProjectConfig) { |
12 | 12 | const { packageManager, frontend, projectDir } = config; |
13 | | - const s = spinner(); |
14 | 13 | const clientPackageDir = path.join(projectDir, "apps/web"); |
15 | 14 |
|
16 | 15 | if (!(await fs.pathExists(clientPackageDir))) { |
17 | 16 | return; |
18 | 17 | } |
19 | 18 |
|
20 | 19 | try { |
21 | | - s.start("Setting up Tauri desktop app support..."); |
| 20 | + log.step("Setting up Tauri desktop app support..."); |
22 | 21 |
|
23 | 22 | await addPackageDependency({ |
24 | 23 | devDependencies: ["@tauri-apps/cli"], |
@@ -80,9 +79,9 @@ export async function setupTauri(config: ProjectConfig) { |
80 | 79 |
|
81 | 80 | await $`${{ raw: tauriInitCommand }}`.cwd(clientPackageDir).env({ CI: "true" }); |
82 | 81 |
|
83 | | - s.stop("Tauri desktop app support configured successfully!"); |
| 82 | + log.success("Tauri desktop app support configured successfully!"); |
84 | 83 | } catch (error) { |
85 | | - s.stop(pc.red("Failed to set up Tauri")); |
| 84 | + log.error("Failed to set up Tauri"); |
86 | 85 | if (error instanceof Error) { |
87 | 86 | consola.error(pc.red(error.message)); |
88 | 87 | } |
|
0 commit comments