@code-pushup/core 0.22.3 → 0.22.5
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/index.js +5 -20
- package/package.json +1 -1
- package/src/lib/collect-and-persist.d.ts +4 -2
- package/src/lib/normalize.d.ts +1 -2
- package/src/lib/upload.d.ts +1 -1
package/index.js
CHANGED
|
@@ -473,11 +473,6 @@ function refineCoreConfig(schema) {
|
|
|
473
473
|
var CONFIG_FILE_NAME = "code-pushup.config";
|
|
474
474
|
var SUPPORTED_CONFIG_FILE_FORMATS = ["ts", "mjs", "js"];
|
|
475
475
|
|
|
476
|
-
// packages/models/src/lib/implementation/constants.ts
|
|
477
|
-
var PERSIST_OUTPUT_DIR = ".code-pushup";
|
|
478
|
-
var PERSIST_FORMAT = ["json"];
|
|
479
|
-
var PERSIST_FILENAME = "report";
|
|
480
|
-
|
|
481
476
|
// packages/models/src/lib/report.ts
|
|
482
477
|
import { z as z12 } from "zod";
|
|
483
478
|
var auditReportSchema = auditSchema.merge(auditOutputSchema);
|
|
@@ -1541,20 +1536,12 @@ var verboseUtils = (verbose = false) => ({
|
|
|
1541
1536
|
|
|
1542
1537
|
// packages/core/package.json
|
|
1543
1538
|
var name = "@code-pushup/core";
|
|
1544
|
-
var version = "0.22.
|
|
1539
|
+
var version = "0.22.5";
|
|
1545
1540
|
|
|
1546
1541
|
// packages/core/src/lib/implementation/execute-plugin.ts
|
|
1547
1542
|
import chalk5 from "chalk";
|
|
1548
1543
|
|
|
1549
1544
|
// packages/core/src/lib/normalize.ts
|
|
1550
|
-
function normalizePersistConfig(cfg) {
|
|
1551
|
-
return {
|
|
1552
|
-
outputDir: PERSIST_OUTPUT_DIR,
|
|
1553
|
-
filename: PERSIST_FILENAME,
|
|
1554
|
-
format: PERSIST_FORMAT,
|
|
1555
|
-
...cfg
|
|
1556
|
-
};
|
|
1557
|
-
}
|
|
1558
1545
|
async function normalizeAuditOutputs(audits) {
|
|
1559
1546
|
const gitRoot = await getGitRoot();
|
|
1560
1547
|
return audits.map((audit) => {
|
|
@@ -1769,8 +1756,7 @@ function logPersistedResults(persistResults) {
|
|
|
1769
1756
|
async function collectAndPersistReports(options) {
|
|
1770
1757
|
const { exec } = verboseUtils(options.verbose);
|
|
1771
1758
|
const report = await collect(options);
|
|
1772
|
-
const
|
|
1773
|
-
const persistResults = await persistReport(report, persist);
|
|
1759
|
+
const persistResults = await persistReport(report, options.persist);
|
|
1774
1760
|
exec(() => {
|
|
1775
1761
|
logPersistedResults(persistResults);
|
|
1776
1762
|
});
|
|
@@ -1929,13 +1915,12 @@ function issueSeverityToGQL(severity) {
|
|
|
1929
1915
|
|
|
1930
1916
|
// packages/core/src/lib/upload.ts
|
|
1931
1917
|
async function upload(options, uploadFn = uploadToPortal) {
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
throw new Error("upload config must be set");
|
|
1918
|
+
if (options.upload == null) {
|
|
1919
|
+
throw new Error("Upload configuration is not set.");
|
|
1935
1920
|
}
|
|
1936
1921
|
const { apiKey, server, organization, project, timeout } = options.upload;
|
|
1937
1922
|
const report = await loadReport({
|
|
1938
|
-
...persist,
|
|
1923
|
+
...options.persist,
|
|
1939
1924
|
format: "json"
|
|
1940
1925
|
});
|
|
1941
1926
|
const commitData = await getLatestCommit();
|
package/package.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { CoreConfig } from '@code-pushup/models';
|
|
1
|
+
import { CoreConfig, PersistConfig } from '@code-pushup/models';
|
|
2
2
|
import { GlobalOptions } from './types';
|
|
3
|
-
export type CollectAndPersistReportsOptions = Required<Pick<CoreConfig, '
|
|
3
|
+
export type CollectAndPersistReportsOptions = Required<Pick<CoreConfig, 'plugins' | 'categories'>> & {
|
|
4
|
+
persist: Required<PersistConfig>;
|
|
5
|
+
} & GlobalOptions;
|
|
4
6
|
export declare function collectAndPersistReports(options: CollectAndPersistReportsOptions): Promise<void>;
|
package/src/lib/normalize.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { type AuditOutputs
|
|
2
|
-
export declare function normalizePersistConfig(cfg?: Partial<PersistConfig>): Required<PersistConfig>;
|
|
1
|
+
import { type AuditOutputs } from '@code-pushup/models';
|
|
3
2
|
export declare function normalizeAuditOutputs(audits: AuditOutputs): Promise<AuditOutputs>;
|
package/src/lib/upload.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { uploadToPortal } from '@code-pushup/portal-client';
|
|
|
2
2
|
import { PersistConfig, UploadConfig } from '@code-pushup/models';
|
|
3
3
|
import { GlobalOptions } from './types';
|
|
4
4
|
export type UploadOptions = {
|
|
5
|
-
upload
|
|
5
|
+
upload?: UploadConfig;
|
|
6
6
|
} & {
|
|
7
7
|
persist: Required<PersistConfig>;
|
|
8
8
|
} & GlobalOptions;
|