Skip to content

Commit

Permalink
feat: make portal-client dependency optional
Browse files Browse the repository at this point in the history
  • Loading branch information
hanna-skryl committed Oct 11, 2024
1 parent 989dbec commit 7c7c826
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/lib/compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
calcDuration,
ensureDirectoryExists,
generateMdReportsDiff,
loadPortalClient,
readJsonFile,
scoreReport,
ui,
Expand All @@ -25,6 +24,7 @@ import {
compareCategories,
compareGroups,
} from './implementation/compare-scorables';
import { loadPortalClient } from './load-portal-client';

export async function compareReportFiles(
inputPaths: Diff<string>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ui } from './logging';
import { ui } from '@code-pushup/utils';

Check failure on line 1 in packages/core/src/lib/load-portal-client.ts

View workflow job for this annotation

GitHub Actions / Code PushUp

<✓> Code coverage | Branch coverage

1st branch is not taken in any test case.

export async function loadPortalClient(): Promise<
typeof import('@code-pushup/portal-client') | null
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/lib/upload.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { SaveReportMutationVariables } from '@code-pushup/portal-client';
import type { PersistConfig, Report, UploadConfig } from '@code-pushup/models';
import { loadPortalClient, loadReport } from '@code-pushup/utils';
import { loadReport } from '@code-pushup/utils';
import { reportToGQL } from './implementation/report-to-gql';
import { loadPortalClient } from './load-portal-client';
import type { GlobalOptions } from './types';

export type UploadOptions = { upload?: UploadConfig } & {
Expand Down
1 change: 0 additions & 1 deletion packages/utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,3 @@ export type {
WithRequired,
} from './lib/types';
export { verboseUtils } from './lib/verbose-utils';
export { loadPortalClient } from './lib/load-portal-client';
2 changes: 1 addition & 1 deletion packages/utils/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"declaration": true,
"types": ["node"]
},
"include": ["src/**/*.ts"],
"include": ["src/**/*.ts", "../core/src/lib/load-portal-client.ts"],
"exclude": [
"vite.config.unit.ts",
"vite.config.integration.ts",
Expand Down

0 comments on commit 7c7c826

Please sign in to comment.