-
Notifications
You must be signed in to change notification settings - Fork 934
chore: migrate from ora to nanospinner
#2640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| import fs from 'fs'; | ||
| import execa from 'execa'; | ||
| import type {Ora} from 'ora'; | ||
| import pico from 'picocolors'; | ||
| import chalk from 'chalk'; | ||
|
Check failure on line 4 in packages/cli-config-apple/src/tools/installPods.ts
|
||
|
||
| import { | ||
| logger, | ||
| NoopLoader, | ||
|
|
@@ -23,13 +23,13 @@ | |
| newArchEnabled?: boolean; | ||
| } | ||
|
|
||
| async function runPodInstall(loader: Ora, options: RunPodInstallOptions) { | ||
| async function runPodInstall(loader: Spinner, options: RunPodInstallOptions) { | ||
|
Check failure on line 26 in packages/cli-config-apple/src/tools/installPods.ts
|
||
| const shouldHandleRepoUpdate = options?.shouldHandleRepoUpdate || true; | ||
| try { | ||
| loader.start( | ||
| `Installing CocoaPods dependencies ${pico.bold( | ||
|
Check failure on line 30 in packages/cli-config-apple/src/tools/installPods.ts
|
||
| options?.newArchEnabled ? 'with New Architecture' : '', | ||
| )} ${pico.dim('(this may take a few minutes)')}`, | ||
|
Check failure on line 32 in packages/cli-config-apple/src/tools/installPods.ts
|
||
| ); | ||
|
|
||
| await execaPod(['install'], { | ||
|
|
@@ -66,7 +66,7 @@ | |
| newArchEnabled: options?.newArchEnabled, | ||
| }); | ||
| } else { | ||
| loader.fail(); | ||
| loader.error(); | ||
| logger.error(stderr); | ||
|
|
||
| throw new CLIError( | ||
|
|
@@ -80,10 +80,10 @@ | |
| } | ||
| } | ||
|
|
||
| async function runPodUpdate(loader: Ora) { | ||
| async function runPodUpdate(loader: Spinner) { | ||
|
Check failure on line 83 in packages/cli-config-apple/src/tools/installPods.ts
|
||
| try { | ||
| loader.start( | ||
| `Updating CocoaPods repositories ${pico.dim( | ||
|
Check failure on line 86 in packages/cli-config-apple/src/tools/installPods.ts
|
||
| '(this may take a few minutes)', | ||
| )}`, | ||
| ); | ||
|
|
@@ -91,11 +91,11 @@ | |
| } catch (error) { | ||
| // "pod" command outputs errors to stdout (at least some of them) | ||
| logger.log((error as any).stderr || (error as any).stdout); | ||
| loader.fail(); | ||
| loader.error(); | ||
|
|
||
| throw new CLIError( | ||
| `Failed to update CocoaPods repositories for iOS project.\nPlease try again manually: "pod repo update".\nCocoaPods documentation: ${pico.dim( | ||
|
Check failure on line 97 in packages/cli-config-apple/src/tools/installPods.ts
|
||
| pico.underline('https://cocoapods.org/'), | ||
|
Check failure on line 98 in packages/cli-config-apple/src/tools/installPods.ts
|
||
| )}`, | ||
| ); | ||
| } | ||
|
|
@@ -113,17 +113,17 @@ | |
| } | ||
| } | ||
|
|
||
| async function installCocoaPods(loader: Ora) { | ||
| async function installCocoaPods(loader: Spinner) { | ||
|
Check failure on line 116 in packages/cli-config-apple/src/tools/installPods.ts
|
||
| loader.stop(); | ||
|
|
||
| loader.start('Installing CocoaPods'); | ||
|
|
||
| try { | ||
| await installCocoaPodsWithGem(); | ||
|
|
||
| return loader.succeed(); | ||
| return loader.success(); | ||
| } catch (error) { | ||
| loader.fail(); | ||
| loader.error(); | ||
| logger.error((error as any).stderr); | ||
|
|
||
| throw new CLIError( | ||
|
|
@@ -134,7 +134,7 @@ | |
| } | ||
| } | ||
|
|
||
| async function installPods(loader?: Ora, options?: PodInstallOptions) { | ||
| async function installPods(loader?: Spinner, options?: PodInstallOptions) { | ||
| loader = loader || new NoopLoader(); | ||
| try { | ||
| if (!options?.iosFolderPath && !fs.existsSync('ios')) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import statement still references the old
orapackage type. This should be updated to importSpinnerfromnanospinnerinstead. The typeOrais no longer available after migrating to nanospinner.