@code-pushup/core 0.26.1 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@code-pushup/core",
3
- "version": "0.26.1",
3
+ "version": "0.28.0",
4
4
  "license": "MIT",
5
5
  "dependencies": {
6
6
  "@code-pushup/models": "*",
7
7
  "@code-pushup/utils": "*",
8
8
  "@code-pushup/portal-client": "^0.6.1",
9
- "chalk": "^5.3.0"
9
+ "chalk": "^5.3.0",
10
+ "simple-git": "^3.20.0"
10
11
  },
11
12
  "type": "module",
12
13
  "main": "./index.js",
package/src/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export { CollectAndPersistReportsOptions, collectAndPersistReports, } from './lib/collect-and-persist';
2
+ export { compareReportFiles, compareReports } from './lib/compare';
2
3
  export { CollectOptions, collect } from './lib/implementation/collect';
4
+ export { ReportsToCompare } from './lib/implementation/compare-scorables';
3
5
  export { PluginOutputMissingAuditError, executePlugin, executePlugins, } from './lib/implementation/execute-plugin';
4
6
  export { PersistDirError, PersistError, persistReport, } from './lib/implementation/persist';
5
7
  export { ConfigPathError, autoloadRc, readRcByPath, } from './lib/implementation/read-rc-file';
@@ -2,5 +2,5 @@ import { CoreConfig, PersistConfig } from '@code-pushup/models';
2
2
  import { GlobalOptions } from './types';
3
3
  export type CollectAndPersistReportsOptions = Required<Pick<CoreConfig, 'plugins' | 'categories'>> & {
4
4
  persist: Required<PersistConfig>;
5
- } & GlobalOptions;
5
+ } & Partial<GlobalOptions>;
6
6
  export declare function collectAndPersistReports(options: CollectAndPersistReportsOptions): Promise<void>;
@@ -0,0 +1,4 @@
1
+ import { type PersistConfig, Report, ReportsDiff } from '@code-pushup/models';
2
+ import { Diff } from '@code-pushup/utils';
3
+ export declare function compareReportFiles(inputPaths: Diff<string>, persistConfig: Required<PersistConfig>): Promise<string[]>;
4
+ export declare function compareReports(reports: Diff<Report>): ReportsDiff;
@@ -0,0 +1,15 @@
1
+ import { LogOptions, LogResult } from 'simple-git';
2
+ import { CoreConfig, PersistConfig, UploadConfig } from '@code-pushup/models';
3
+ import { GlobalOptions } from './types';
4
+ export type HistoryOnlyOptions = {
5
+ targetBranch?: string;
6
+ skipUploads?: boolean;
7
+ forceCleanStatus?: boolean;
8
+ };
9
+ export type HistoryOptions = Required<Pick<CoreConfig, 'plugins' | 'categories'>> & {
10
+ persist: Required<PersistConfig>;
11
+ upload?: Required<UploadConfig>;
12
+ } & HistoryOnlyOptions & Partial<GlobalOptions>;
13
+ export declare function history(config: HistoryOptions, commits: string[]): Promise<string[]>;
14
+ export declare function getHashes(options: LogOptions, git?: import("simple-git").SimpleGit): Promise<string[]>;
15
+ export declare function prepareHashes(logs: LogResult): string[];
@@ -1,6 +1,6 @@
1
1
  import { CoreConfig, Report } from '@code-pushup/models';
2
2
  import { GlobalOptions } from '../types';
3
- export type CollectOptions = Required<Pick<CoreConfig, 'plugins' | 'categories'>> & GlobalOptions;
3
+ export type CollectOptions = Required<Pick<CoreConfig, 'plugins' | 'categories'>> & Partial<GlobalOptions>;
4
4
  /**
5
5
  * Run audits, collect plugin output and aggregate it into a JSON object
6
6
  * @param options
@@ -0,0 +1,6 @@
1
+ import { ReportsDiff } from '@code-pushup/models';
2
+ import { Diff, ScoredReport } from '@code-pushup/utils';
3
+ export type ReportsToCompare = Diff<ScoredReport>;
4
+ export declare function compareCategories(reports: ReportsToCompare): ReportsDiff['categories'];
5
+ export declare function compareGroups(reports: ReportsToCompare): ReportsDiff['groups'];
6
+ export declare function compareAudits(reports: ReportsToCompare): ReportsDiff['audits'];
@@ -50,5 +50,5 @@ export declare function executePlugin(pluginConfig: PluginConfig, onProgress?: O
50
50
  *
51
51
  */
52
52
  export declare function executePlugins(plugins: PluginConfig[], options?: {
53
- progress: boolean;
53
+ progress?: boolean;
54
54
  }): Promise<PluginReport[]>;
@@ -5,7 +5,7 @@ export type UploadOptions = {
5
5
  upload?: UploadConfig;
6
6
  } & {
7
7
  persist: Required<PersistConfig>;
8
- } & GlobalOptions;
8
+ } & Partial<GlobalOptions>;
9
9
  /**
10
10
  * Uploads collected audits to the portal
11
11
  * @param options