()
| 2 | import { logger, stringifyError } from '@code-pushup/utils'; |
| 3 | |
| 4 | export async function loadPortalClient(): Promise< |
| 5 | typeof import('@code-pushup/portal-client') |
| 6 | > { |
| 7 | try { |
| 8 | return await import('@code-pushup/portal-client'); |
| 9 | } catch (error) { |
| 10 | logger.error( |
| 11 | `Failed to import @code-pushup/portal-client - ${stringifyError(error)}`, |
| 12 | ); |
| 13 | throw new Error( |
| 14 | `The ${ansis.bold('@code-pushup/portal-client')} peer dependency must be installed to enable uploading to Portal.`, |
| 15 | ); |
| 16 | } |
| 17 | } |
no test coverage detected