MCPcopy Create free account
hub / github.com/code-pushup/cli / loadPortalClient

Function loadPortalClient

packages/core/src/lib/load-portal-client.ts:4–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import { logger, stringifyError } from '@code-pushup/utils';
3
4export 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}

Callers 2

uploadFunction · 0.85

Calls 2

stringifyErrorFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected